Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #14565 - No csrf_token on 404 pages

Thanks to gvangool for report and patch.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 851f42ba277eec8081b8493d59a1506b6ce15c77 1 parent 298f3d3
@spookylukey spookylukey authored
Showing with 3 additions and 0 deletions.
  1. +3 −0  django/views/
3  django/views/
@@ -1,6 +1,8 @@
from django import http
from django.template import Context, RequestContext, loader
+from django.views.decorators.csrf import csrf_protect
def page_not_found(request, template_name='404.html'):
Default 404 handler.
@@ -13,6 +15,7 @@ def page_not_found(request, template_name='404.html'):
t = loader.get_template(template_name) # You need to create a 404.html template.
return http.HttpResponseNotFound(t.render(RequestContext(request, {'request_path': request.path})))
def server_error(request, template_name='500.html'):
500 error handler.
Please sign in to comment.
Something went wrong with that request. Please try again.