Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #8287: the debug page now shows the actual requested URL even i…

…f you've messed with request.path. Patch from Giuliani Vito Ivan.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@8633 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 887f778794d23968b9060e35d11065577e12cebe 1 parent 2e9a880
@jacobian jacobian authored
Showing with 9 additions and 9 deletions.
  1. +9 −9 django/views/debug.py
View
18 django/views/debug.py
@@ -254,7 +254,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
+ 'request_path': request.path_info[1:], # Trim leading slash
'urlpatterns': tried,
'reason': smart_str(exception, errors='replace'),
'request': request,
@@ -282,7 +282,7 @@ def empty_urlconf(request):
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="robots" content="NONE,NOARCHIVE">
- <title>{{ exception_type }} at {{ request.path|escape }}</title>
+ <title>{{ exception_type }} at {{ request.path_info|escape }}</title>
<style type="text/css">
html * { padding:0; margin:0; }
body * { padding:10px 20px; }
@@ -388,7 +388,7 @@ def empty_urlconf(request):
</head>
<body>
<div id="summary">
- <h1>{{ exception_type }} at {{ request.path|escape }}</h1>
+ <h1>{{ exception_type }} at {{ request.path_info|escape }}</h1>
<pre class="exception_value">{{ exception_value|escape }}</pre>
<table class="meta">
<tr>
@@ -397,7 +397,7 @@ def empty_urlconf(request):
</tr>
<tr>
<th>Request URL:</th>
- <td>{{ request_protocol }}://{{ request.META.HTTP_HOST }}{{ request.path|escape }}</td>
+ <td>{{ request_protocol }}://{{ request.META.HTTP_HOST }}{{ request.path_info|escape }}</td>
</tr>
<tr>
<th>Exception Type:</th>
@@ -520,14 +520,14 @@ def empty_urlconf(request):
<form action="http://dpaste.com/" name="pasteform" id="pasteform" method="post">
<div id="pastebinTraceback" class="pastebin">
<input type="hidden" name="language" value="PythonConsole">
- <input type="hidden" name="title" value="{{ exception_type|escape }} at {{ request.path|escape }}">
+ <input type="hidden" name="title" value="{{ exception_type|escape }} at {{ request.path_info|escape }}">
<input type="hidden" name="source" value="Django Dpaste Agent">
<input type="hidden" name="poster" value="Django">
<textarea name="content" id="traceback_area" cols="140" rows="25">
Environment:
Request Method: {{ request.META.REQUEST_METHOD }}
-Request URL: {{ request_protocol }}://{{ request.META.HTTP_HOST }}{{ request.path|escape }}
+Request URL: {{ request_protocol }}://{{ request.META.HTTP_HOST }}{{ request.path_info|escape }}
Django Version: {{ django_version_info }}
Python Version: {{ sys_version_info }}
Installed Applications:
@@ -554,7 +554,7 @@ def empty_urlconf(request):
{% for frame in frames %}File "{{ frame.filename|escape }}" in {{ frame.function|escape }}
{% if frame.context_line %} {{ frame.lineno }}. {{ frame.context_line|escape }}{% endif %}
{% endfor %}
-Exception Type: {{ exception_type|escape }} at {{ request.path|escape }}
+Exception Type: {{ exception_type|escape }} at {{ request.path_info|escape }}
Exception Value: {{ exception_value|escape }}
</textarea>
<br><br>
@@ -687,7 +687,7 @@ def empty_urlconf(request):
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
- <title>Page not found at {{ request.path|escape }}</title>
+ <title>Page not found at {{ request.path_info|escape }}</title>
<meta name="robots" content="NONE,NOARCHIVE">
<style type="text/css">
html * { padding:0; margin:0; }
@@ -717,7 +717,7 @@ def empty_urlconf(request):
</tr>
<tr>
<th>Request URL:</th>
- <td>{{ request_protocol }}://{{ request.META.HTTP_HOST }}{{ request.path|escape }}</td>
+ <td>{{ request_protocol }}://{{ request.META.HTTP_HOST }}{{ request.path_info|escape }}</td>
</tr>
</table>
</div>
Please sign in to comment.
Something went wrong with that request. Please try again.