This is a memo for beginners. Even if you do it as you googled in your environment It didn't move, so it's a memo when I managed to move.
django 1.11
document https://django-debug-toolbar.readthedocs.io/en/stable/
$ pip install django-debug-toolbar
I copied it from the link below. .. .. http://stackoverflow.com/questions/6390310/how-do-i-see-the-django-debug-toolbar
settings.py
if DEBUG:
INTERNAL_IPS = ('127.0.0.1',)
MIDDLEWARE += (
'debug_toolbar.middleware.DebugToolbarMiddleware',
)
INSTALLED_APPS += (
'debug_toolbar',
)
#Contents to be displayed
DEBUG_TOOLBAR_PANELS = [
'debug_toolbar.panels.versions.VersionsPanel',
'debug_toolbar.panels.timer.TimerPanel',
'debug_toolbar.panels.settings.SettingsPanel',
'debug_toolbar.panels.headers.HeadersPanel',
'debug_toolbar.panels.request.RequestPanel',
'debug_toolbar.panels.sql.SQLPanel',
'debug_toolbar.panels.staticfiles.StaticFilesPanel',
'debug_toolbar.panels.templates.TemplatesPanel',
'debug_toolbar.panels.cache.CachePanel',
'debug_toolbar.panels.signals.SignalsPanel',
'debug_toolbar.panels.logging.LoggingPanel',
'debug_toolbar.panels.redirects.RedirectsPanel',
]
DEBUG_TOOLBAR_CONFIG = {
'INTERCEPT_REDIRECTS': False,
}
Please rewrite your_app in a timely manner.
urls.py
from django.conf import settings
from django.conf.urls import url, include
from django.contrib import admin
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^your_app/', include('your_app.urls')),
]
if settings.DEBUG:
import debug_toolbar
urlpatterns += (
url(r'^your_app/', include(debug_toolbar.urls)),
)
By default, the body tag is searched and inserted immediately before. Therefore, it will not be displayed without the body tag.
Honestly, even if you look at debug-toolbar? I'm a beginner with many things, but I was happy that it worked. I often don't know the settings, so I want to study little by little.
Recommended Posts