Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#13542 closed (wontfix)

Feature request: Debug 404 URL patterns as links

Reported by: Erik Wognsen Owned by: nobody
Component: Uncategorized Version: dev
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

When you get the debug 404 page, it says, for example:

Using the URLconf defined in urls, Django tried these URL patterns, in this order:

1. ^user/
2. ^ratings/
3. ^ratings/user/(?P<user_id>\d+)/$
...

The current URL, , didn't match any of these.

It would be nice if the simple ones (1 and 2 above) were links, simply to /user/ and /ratings/. I've included a quick patch that does that.

To work on URLconfs included from the main URLconf it needs some improvement, but I don't know how to do that and don't want to work on it unless the feature in general is found relevant. The regex probably also needs some more thought.

Attachments (1)

debug_404_links.diff (1.2 KB ) - added by Erik Wognsen 15 years ago.

Download all attachments as: .zip

Change History (3)

by Erik Wognsen, 15 years ago

Attachment: debug_404_links.diff added

comment:1 by Karen Tracey, 15 years ago

Resolution: wontfix
Status: newclosed

Thanks for the suggestion, but I fear this would cause more confusion than shed light during debugging -- I don't think it would be at all clear to many why some patterns get links associated with them and others do not. Also, the key question for the programmer when faced with an unexpected 404 page is "Why didn't any of the listed patterns match?", and having some of the patterns show as links does not help answer that question, so they would strike me as more of a distraction than anything else. (Also, for future reference, Django supports Pythons as far back as 2.4. format is new in Python 2.6 so the proposed patch could not be used as-is if this were to be done; it would need to be reworked so the code ran on Pythons as old as 2.4.)

comment:2 by Erik Wognsen, 15 years ago

Yeah, I see your point. I just made it because I was working on a project which had no root page for at long time. Also, forgot about format. I'll remember that for another time!

Note: See TracTickets for help on using tickets.
Back to Top