Ticket #13542: debug_404_links.diff
File debug_404_links.diff, 1.2 KB (added by , 14 years ago) |
---|
-
django/views/debug.py
275 275 # tried exists but is an empty list. The URLconf must've been empty. 276 276 return empty_urlconf(request) 277 277 278 # Make the debug 404 list URL patterns as links where applicable: 279 280 # The patterns need to be output as safe to render the links, so escape 281 # them now before the the links are added 282 tried = map(escape, tried) 283 284 for pattern in tried: 285 match = re.match('\^([/\w]*)\$?$', pattern) 286 if match: 287 tried[tried.index(pattern)] = ( 288 u'<a href="/{0}">{1}</a>'.format(match.group(1), pattern)) 289 278 290 t = Template(TECHNICAL_404_TEMPLATE, name='Technical 404 template') 279 291 c = Context({ 280 292 'root_urlconf': settings.ROOT_URLCONF, … … 778 790 </p> 779 791 <ol> 780 792 {% for pattern in urlpatterns %} 781 <li>{{ pattern }}</li>793 <li>{{ pattern|safe }}</li> 782 794 {% endfor %} 783 795 </ol> 784 796 <p>The current URL, <code>{{ request_path|escape }}</code>, didn't match any of these.</p>