Django

Code

Changeset 8633

Show
Ignore:
Timestamp:
08/27/08 14:59:29 (3 months ago)
Author:
jacob
Message:

Fixed #8287: the debug page now shows the actual requested URL even if you've messed with request.path. Patch from Giuliani Vito Ivan.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/views/debug.py

    r8560 r8633  
    255255    c = Context({ 
    256256        'root_urlconf': settings.ROOT_URLCONF, 
    257         'request_path': request.path[1:], # Trim leading slash 
     257        'request_path': request.path_info[1:], # Trim leading slash 
    258258        'urlpatterns': tried, 
    259259        'reason': smart_str(exception, errors='replace'), 
     
    283283  <meta http-equiv="content-type" content="text/html; charset=utf-8"> 
    284284  <meta name="robots" content="NONE,NOARCHIVE"> 
    285   <title>{{ exception_type }} at {{ request.path|escape }}</title> 
     285  <title>{{ exception_type }} at {{ request.path_info|escape }}</title> 
    286286  <style type="text/css"> 
    287287    html * { padding:0; margin:0; } 
     
    389389<body> 
    390390<div id="summary"> 
    391   <h1>{{ exception_type }} at {{ request.path|escape }}</h1> 
     391  <h1>{{ exception_type }} at {{ request.path_info|escape }}</h1> 
    392392  <pre class="exception_value">{{ exception_value|escape }}</pre> 
    393393  <table class="meta"> 
     
    398398    <tr> 
    399399      <th>Request URL:</th> 
    400       <td>{{ request_protocol }}://{{ request.META.HTTP_HOST }}{{ request.path|escape }}</td> 
     400      <td>{{ request_protocol }}://{{ request.META.HTTP_HOST }}{{ request.path_info|escape }}</td> 
    401401    </tr> 
    402402    <tr> 
     
    521521  <div id="pastebinTraceback" class="pastebin"> 
    522522    <input type="hidden" name="language" value="PythonConsole"> 
    523     <input type="hidden" name="title" value="{{ exception_type|escape }} at {{ request.path|escape }}"> 
     523    <input type="hidden" name="title" value="{{ exception_type|escape }} at {{ request.path_info|escape }}"> 
    524524    <input type="hidden" name="source" value="Django Dpaste Agent"> 
    525525    <input type="hidden" name="poster" value="Django"> 
     
    528528 
    529529Request Method: {{ request.META.REQUEST_METHOD }} 
    530 Request URL: {{ request_protocol }}://{{ request.META.HTTP_HOST }}{{ request.path|escape }} 
     530Request URL: {{ request_protocol }}://{{ request.META.HTTP_HOST }}{{ request.path_info|escape }} 
    531531Django Version: {{ django_version_info }} 
    532532Python Version: {{ sys_version_info }} 
     
    555555{% if frame.context_line %}  {{ frame.lineno }}. {{ frame.context_line|escape }}{% endif %} 
    556556{% endfor %} 
    557 Exception Type: {{ exception_type|escape }} at {{ request.path|escape }} 
     557Exception Type: {{ exception_type|escape }} at {{ request.path_info|escape }} 
    558558Exception Value: {{ exception_value|escape }} 
    559559</textarea> 
     
    688688<head> 
    689689  <meta http-equiv="content-type" content="text/html; charset=utf-8"> 
    690   <title>Page not found at {{ request.path|escape }}</title> 
     690  <title>Page not found at {{ request.path_info|escape }}</title> 
    691691  <meta name="robots" content="NONE,NOARCHIVE"> 
    692692  <style type="text/css"> 
     
    718718      <tr> 
    719719        <th>Request URL:</th> 
    720       <td>{{ request_protocol }}://{{ request.META.HTTP_HOST }}{{ request.path|escape }}</td> 
     720      <td>{{ request_protocol }}://{{ request.META.HTTP_HOST }}{{ request.path_info|escape }}</td> 
    721721      </tr> 
    722722    </table>