django-forms-builder icon indicating copy to clipboard operation
django-forms-builder copied to clipboard

render_to_response is deprecated in higher Django versions from 1.9 onwards

Open ghost opened this issue 7 years ago • 1 comments

I had the issue with template context_processor, when i tried to upgrade the system from 1.5 to 1.10.7.

there was Keyerror 'request' in context

I fixed it by using render instead of using render_to_response in views.py like this

def form_sent(request, slug, template="forms/form_sent.html"):
    """
    Show the response message.
    """
    published = Form.objects.published(for_user=request.user)
    context = {"form": get_object_or_404(published, slug=slug)}
    return render(request, template, context) # replaced

May be you can update this for higher django version.

cheers!!!!

ghost avatar May 16 '18 14:05 ghost

Could you create a pull request with the fix? Thanks

stephenmcd avatar May 17 '18 02:05 stephenmcd