Skip to content

render_to_response is deprecated in higher Django versions from 1.9 onwards  #225

@ghost

Description

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!!!!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions