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:
parent
0498eb30cb
commit
0e0a1dc0b7
|
@ -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 %}
|
||||||
|
|
Loading…
Reference in New Issue