django-extensions/django-extensions — pull request #555 by quinox (2014-09-06 21:27:16+00:00)
Title: Include namespace in URL name

When using ``show_urls`` the namespace wasn't part of the output:

python manage.py show_urls -f table

URL | Module | Name | Decorator
---------+------------------------------------+--------------+-
/ | project.myownapp.views.Home | home |
/admin/ | django.contrib.admin.sites.index | index |
...

This resulted in the inconsistent behaviour where you could use ``{% url 'home' %}`` in a template without any problems, but using ``{% url 'index' %}`` would result in the template error `Reverse for 'index' with arguments '()' and keyword arguments '{}' not found.`.

This changeset fixes that by including the namespace in the output of ``show_urls``:

python manage.py show_urls -f table

URL | Module | Name | Decorator
---------+------------------------------------+--------------+-
/ | project.myownapp.views.Home | home |
/admin/ | django.contrib.admin.sites.index | admin:index |
...

Caveat emptor: The change was made without intimite knowledge of how Django determines where a request should end up. I did take a small peek at ``django.core.urlresolvers`` though.