From fecc815f3f67a25439cc1b5662e3254224cd1309 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Mon, 1 May 2006 23:29:59 +0000 Subject: [PATCH] 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 --- django/views/defaults.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/django/views/defaults.py b/django/views/defaults.py index 71df6f41c2..d5460a7495 100644 --- a/django/views/defaults.py +++ b/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'): """