My question is about setting up to use django-debug. I'm getting the above error after installing the toolbar and panel, and enabling these in my app. I've seen many suggestions for this or a closely related issue, and nothing I've tried has helped.
The specific error, during template rendering of /usr/lib/python3.6/site-packages/debug_toolbar/templates/debug_toolbar/base.html, is from:
16 data-render-panel-url="{% url 'djdt:render_panel' %}"
My relevant settings.py entries:
DEBUG = True
INSTALLED_APPS = [
'debug_toolbar',
'debug_panel',
...
]
MIDDLEWARE = [
'debug_toolbar.middleware.DebugToolbarMiddleware',
'debug_panel.middleware.DebugPanelMiddleware',
...
]
INTERNAL_IPS = ['127.0.0.1',]
Appended to my urls.py:
if settings.DEBUG:
try:
import debug_toolbar
urlpatterns += [url(r'^__debug__/', include(debug_toolbar.urls))]
except ImportError:
pass
What I've tried:
Thanks for any further suggestions.
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' in your project):
if settings.DEBUG:
import debug_toolbar
urlpatterns += [
url(r'^__debug__/', include(debug_toolbar.urls)),
]