-
Notifications
You must be signed in to change notification settings - Fork 1.1k
django.urls.exceptions.NoReverseMatch: 'djdt' is not a registered namespace #1332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
You should only include the debug toolbar's urls when |
Thank you @tim-schilling for your response |
You could configure the debug toolbar with an environment variable, then run Or you can create a separate local settings file and use that in the call to runserver via If you have it available, there's a chapter on Settings and Requirements files in Two Scoops of Django that goes into detail about this. |
Remove the "if settings.DEBUG" guard. This guard is not necessary and leads to several edge cases in local development setups. This is not necessary as all views are guarded by the require_show_toolbar decorator which uses the SHOW_TOOLBAR_CALLBACK setting. This setting is already capable of enabling/disabling across the application when DEBUG is False. By default, when DEBUG is False, these views return a 404 response. By having the URLs always available, the MIDDLEWARE setting also doesn't need special handling when DEBUG is False, simplifing the overall configuration. An application should be able to reliably reverse URLs regardless of the status of DEBUG. Fixes #1035 Fixes #1043 Fixes #1332
…ly with Debug=False (production) to avoid django-commons/django-debug-toolbar#1332 (comment)
…ly with Debug=False (production) to avoid django-commons/django-debug-toolbar#1332 (comment)
Hi there,
I'm trying to configure django-debug-toolbar. As of now i did the following :
settings.py
DEBUG=True
if DEBUG:
INSTALLED_APPS += [ "debug_toolbar", ]
urls.py
if settings.DEBUG:
The toolbar is working correctly, but when i run
pytest tests/
ordocker-compose run --rm app pytest tests/
i get this error :django.urls.exceptions.NoReverseMatch: 'djdt' is not a registered namespace for some tests suite.
So, what did i missed ??
Thank's in advance
The text was updated successfully, but these errors were encountered: