Django url debugger Django url debugger django django

Django url debugger


have you already tried to run

manage.py show_urls

after installing django_extensions?

http://vimeo.com/1720508 - watch from 06:58.

This should give you in what order the url resolution is attempted.

Hope this helps


I would comment out the patterns in your url.py until you get a 404 error when you try to navigate to foo. If that pattern is an include, I would recurse down that and comment out lines in that url.py. Eventually you will know exactly which pattern is matching.

Then I would take the view function that it is calling and hard code that. If it is using a generic view or something subtle, I'd make it as obvious and direct as possible. At that point, you should know which rule is matching and why and what code it is executing in the view.


You can assume, that it goes through the urlpatterns from top to bottom and the first one that matches will be executed.

As you know which view is executed (Y) think about that:

  • if Y is before X: the patterns of Y matches the url (but shouldn't)
  • if X is before Y: the patterns of X doesn't match the url (but should)

Can you provide some more explicit examples of your URLConf? Than I can give you a more explicit answer.