[Answer]-Python and Django request context error

1👍

The error is a KeyError complaining that the key request is not available to the context.

Make sure your TEMPLATE_CONTEXT_PROCESSORS includes django.core.context.processors.request, or are explicitly adding it to the context in the view that is rendering the template.

== EDIT ==

If this is present in the settings, then you also need to make sure that the view itself is returning a RequestContext rather than Context.

Leave a comment