Ticket #7269: debug.py.2.diff
File debug.py.2.diff, 1.4 KB (added by , 16 years ago) |
---|
-
views/debug.py
178 178 if not tried: 179 179 # tried exists but is an empty list. The URLconf must've been empty. 180 180 return empty_urlconf(request) 181 urlpatterns = [(t,t.strip('^$').replace(' ','')) for t in tried] 181 182 182 183 t = Template(TECHNICAL_404_TEMPLATE, name='Technical 404 template') 183 184 c = Context({ 184 185 'root_urlconf': settings.ROOT_URLCONF, 185 186 'request_path': request.path[1:], # Trim leading slash 186 'urlpatterns': tried,187 'urlpatterns': urlpatterns, 187 188 'reason': str(exception), 188 189 'request': request, 189 190 'request_protocol': request.is_secure() and "https" or "http", … … 696 697 Django tried these URL patterns, in this order: 697 698 </p> 698 699 <ol> 699 {% for pattern in urlpatterns %}700 <li> {{ pattern }}</li>700 {% for pattern,guess in urlpatterns %} 701 <li><a href="/{{ guess }}">{{ pattern }}</a</li> 701 702 {% endfor %} 702 703 </ol> 703 <p>The current URL, <code>{{ request_path|escape }}</code>, didn't match any of these.</p>704 <p>The current URL, "<code>{{ request_path|escape }}</code>", didn't match any of these.</p> 704 705 {% else %} 705 706 <p>{{ reason }}</p> 706 707 {% endif %}