Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #14565 - No csrf_token on 404 pages

Thanks to gvangool for report and patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14356 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 851f42ba277eec8081b8493d59a1506b6ce15c77 1 parent 298f3d3
Luke Plant authored October 26, 2010

Showing 1 changed file with 3 additions and 0 deletions. Show diff stats Hide diff stats

  1. 3  django/views/defaults.py
3  django/views/defaults.py
... ...
@@ -1,6 +1,8 @@
1 1
 from django import http
2 2
 from django.template import Context, RequestContext, loader
  3
+from django.views.decorators.csrf import csrf_protect
3 4
 
  5
+@csrf_protect
4 6
 def page_not_found(request, template_name='404.html'):
5 7
     """
6 8
     Default 404 handler.
@@ -13,6 +15,7 @@ def page_not_found(request, template_name='404.html'):
13 15
     t = loader.get_template(template_name) # You need to create a 404.html template.
14 16
     return http.HttpResponseNotFound(t.render(RequestContext(request, {'request_path': request.path})))
15 17
 
  18
+@csrf_protect
16 19
 def server_error(request, template_name='500.html'):
17 20
     """
18 21
     500 error handler.

0 notes on commit 851f42b

Please sign in to comment.
Something went wrong with that request. Please try again.