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
This commit is contained in:
Adrian Holovaty 2007-04-09 01:10:26 +00:00
parent 0498eb30cb
commit 0e0a1dc0b7
1 changed files with 2 additions and 1 deletions

View File

@ -144,6 +144,7 @@ def technical_404_response(request, exception):
t = Template(TECHNICAL_404_TEMPLATE, name='Technical 404 template') t = Template(TECHNICAL_404_TEMPLATE, name='Technical 404 template')
c = Context({ c = Context({
'root_urlconf': settings.ROOT_URLCONF, 'root_urlconf': settings.ROOT_URLCONF,
'request_path': request.path[1:], # Trim leading slash
'urlpatterns': tried, 'urlpatterns': tried,
'reason': str(exception), 'reason': str(exception),
'request': request, 'request': request,
@ -591,7 +592,7 @@ TECHNICAL_404_TEMPLATE = """
<li>{{ pattern|escape }}</li> <li>{{ pattern|escape }}</li>
{% endfor %} {% endfor %}
</ol> </ol>
<p>The current URL, <code>{{ request.path|escape }}</code>, didn't match any of these.</p> <p>The current URL, <code>{{ request_path|escape }}</code>, didn't match any of these.</p>
{% else %} {% else %}
<p>{{ reason|escape }}</p> <p>{{ reason|escape }}</p>
{% endif %} {% endif %}