Skip to content
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

'djdt' is not a registered namespace #2

Open
umair313 opened this issue Oct 15, 2021 · 1 comment
Open

'djdt' is not a registered namespace #2

umair313 opened this issue Oct 15, 2021 · 1 comment

Comments

@umair313
Copy link

on visiting localhost:8000, or localhost:8000/admin/
I get his error
'djdt' is not a registered namespace

Error during template rendering
In template
D:\Python\Django\django-production-template\venv\lib\site-packages\debug_toolbar\templates\debug_toolbar\base.html, error at line 10

'djdt' is not a registered namespace

@willyguevara
Copy link

willyguevara commented Aug 25, 2023

@umair313 You need to manually add djdt routes to the end of urls.py (if you use namespace in your apps, add below codes to urls.py of the project)

if settings.DEBUG:
    import debug_toolbar

    urlpatterns += [
        re_path(r'^__debug__/', include(debug_toolbar.urls)),
    ]

Full code

from django.conf import settings
from django.contrib import admin
from django.urls import path, include, re_path

urlpatterns = [
    path('admin/', admin.site.urls),
]


if settings.DEBUG:
    import debug_toolbar

    urlpatterns += [
        re_path(r'^__debug__/', include(debug_toolbar.urls)),
    ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants