Mercurial > public > sg101
diff comments/views.py @ 1032:e932f2ecd4a7
Django 1.8 warnings / tech debt cleanup.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sat, 26 Dec 2015 15:10:55 -0600 |
parents | 68c3343f3318 |
children | 110bbc78a482 |
line wrap: on
line diff
--- a/comments/views.py Sun Dec 20 22:18:59 2015 -0600 +++ b/comments/views.py Sat Dec 26 15:10:55 2015 -0600 @@ -8,8 +8,7 @@ from django.http import HttpResponseBadRequest from django.http import HttpResponseForbidden from django.db.models import get_model -from django.shortcuts import render_to_response -from django.template import RequestContext +from django.shortcuts import render from django.utils.html import escape from django.views.decorators.http import require_POST @@ -99,10 +98,9 @@ comment.save(html=form.comment_html) # return the rendered comment - return render_to_response('comments/comment.html', { + return render(request, 'comments/comment.html', { 'comment': comment, - }, - context_instance = RequestContext(request)) + }) @require_POST @@ -155,7 +153,6 @@ except ImageCheckError as ex: html = PREVIEW_UNAVAILABLE.format(ex) - return render_to_response('comments/markdown_preview.html', { + return render(request, 'comments/markdown_preview.html', { 'data': html, - }, - context_instance = RequestContext(request)) + })