I have just installed the Django debug toolbar. It was slightly fiddly and although it is working I wanted to check if this is the correct way. Here are the 4 steps that I need to achieve success:
This was largely trial and error so I'm not sure this is the way to go. I am oarticoluarly unsure if step 4 is necessary...
Any input would be much appreciated
I was having the same problems. But, I think I figured it out. I believe the step you are missing is to add 'debug_toolbar' to your projects setting.py INSTALLED_APPS tuple. This solves it for me. Here is a link to the article that I used as a reference.
INTERNAL_IPS
应该是列表或元组,而不是字符串,因此:
INTERNAL_IPS = ('127.0.0.1', ) # note, comma
You have to flow the command Like this:
1.install:
pip install django-debug-toolber
2.settings.py
INSTALLED_APPS = [
.,
.,
'debug_toolbar'
]
MIDDLEWARE = [
'debug_toolbar.middleware.DebugToolbarMiddleware',
.,
.
]
INTERNAL_IPS = [
'127.0.0.1',
]
3. urls.py
import debug_toolbar
urlpatterns = [
path('admin/', admin.site.urls),
path('__debug__/', include('debug_toolbar.urls')),
]
Now you can see the debug_toolbarin when you hit the url.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.