From 0e0a1dc0b717d3354e6bada48a7ea127248a3d7c Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Mon, 9 Apr 2007 01:10:26 +0000 Subject: [PATCH] Fixed #3942 -- Fixed potential confusion on debug 404 page by stripping initial slash from the display of the current URL. Thanks, Collin Grady git-svn-id: http://code.djangoproject.com/svn/django/trunk@4959 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/views/debug.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/django/views/debug.py b/django/views/debug.py index 77b6c2fac2..b49a98a864 100644 --- a/django/views/debug.py +++ b/django/views/debug.py @@ -144,6 +144,7 @@ def technical_404_response(request, exception): t = Template(TECHNICAL_404_TEMPLATE, name='Technical 404 template') c = Context({ 'root_urlconf': settings.ROOT_URLCONF, + 'request_path': request.path[1:], # Trim leading slash 'urlpatterns': tried, 'reason': str(exception), 'request': request, @@ -591,7 +592,7 @@ TECHNICAL_404_TEMPLATE = """
  • {{ pattern|escape }}
  • {% endfor %} -

    The current URL, {{ request.path|escape }}, didn't match any of these.

    +

    The current URL, {{ request_path|escape }}, didn't match any of these.

    {% else %}

    {{ reason|escape }}

    {% endif %}