Commit ac32aa8a by Brodie Rao

Updated custom forbidden template example in the README to use RequestContext

parent 0dce5e03
...@@ -117,13 +117,13 @@ For example, in `views.py`: ...@@ -117,13 +117,13 @@ For example, in `views.py`:
{{{ {{{
from django.http import HttpResponseForbidden from django.http import HttpResponseForbidden
from django.template import Context, loader from django.template import RequestContext, loader
def forbidden(request, template_name='403.html'): def forbidden(request, template_name='403.html'):
"""Default 403 handler""" """Default 403 handler"""
t = loader.get_template(template_name) t = loader.get_template(template_name)
return HttpResponseForbidden(t.render(Context({}))) return HttpResponseForbidden(t.render(RequestContext(request)))
}}} }}}
And in `middleware.py`: And in `middleware.py`:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment