Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

magic-removal: Fixed #1735 -- Default 404 view now gets 'request_path…

…' in template context. Thanks, ubernostrum

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2804 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit fecc815f3f67a25439cc1b5662e3254224cd1309 1 parent 6ed8497
@adrianholovaty adrianholovaty authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 django/views/defaults.py
View
6 django/views/defaults.py
@@ -71,10 +71,12 @@ def page_not_found(request, template_name='404.html'):
table, redirects if found, and displays 404 page if not redirected.
Templates: `404.html`
- Context: None
+ Context:
+ request_path
+ The path of the requested URL (e.g., '/app/pages/bad_page/')
"""
t = loader.get_template(template_name)
- return http.HttpResponseNotFound(t.render(Context()))
+ return http.HttpResponseNotFound(t.render(Context({'request_path': request.path})))
def server_error(request, template_name='500.html'):
"""
Please sign in to comment.
Something went wrong with that request. Please try again.