Author: jacob
Date: 2008-08-27 14:59:29 -0500 (Wed, 27 Aug 2008)
New Revision: 8633

Modified:
   django/trunk/django/views/debug.py
Log:
Fixed #8287: the debug page now shows the actual requested URL even if you've 
messed with request.path. Patch from Giuliani Vito Ivan.

Modified: django/trunk/django/views/debug.py
===================================================================
--- django/trunk/django/views/debug.py  2008-08-27 19:52:27 UTC (rev 8632)
+++ django/trunk/django/views/debug.py  2008-08-27 19:59:29 UTC (rev 8633)
@@ -254,7 +254,7 @@
     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 @@
 <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 @@
 </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 @@
     </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 @@
   <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 @@
 {% 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 @@
 <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 @@
       </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>


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to