In my Django project, I used to have a single URLConf, urls.py
at the root of the project. This URLConf included some named URLs using Django's url()
function. In several templates, I reference these URLs with the url
tag, à la {% url named_url %}
. This worked fine.
The root urls.py
became a bit unwieldy, so I split it off into a URLConf for each app, in app/urls.py
. Some URLs still have names. Unfortunately, I get a TemplateSyntaxException
when using the url
tag in templates now. Specifically, the error message is:
Caught an exception while rendering: Reverse for 'myproj.myapp.new_test' with arguments '()' and keyword arguments '{}' not found.
Is there a way to reference the named URLs in the app-specific URLConfs using the url
tag in Django?