1
Fork 0

Install debug toolbar

This commit is contained in:
Jake Howard 2020-04-12 14:52:22 +01:00
parent 2aedcd3183
commit e4d652ac6b
Signed by: jake
GPG key ID: 57AFB45680EDD477
3 changed files with 33 additions and 5 deletions

View file

@ -1 +1,2 @@
django==3.0.5
django-debug-toolbar==2.2

View file

@ -25,20 +25,19 @@ SECRET_KEY = "gd(%^4!762m4y*c56t(ppm&-5+*a*6-&5)n%nc^aqfi%54^u_j"
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = []
ALLOWED_HOSTS = "*"
# Application definition
INSTALLED_APPS = [
"django.contrib.staticfiles",
]
INSTALLED_APPS = ["django.contrib.staticfiles", "debug_toolbar"]
MIDDLEWARE = [
"django.middleware.security.SecurityMiddleware",
"django.middleware.common.CommonMiddleware",
"django.middleware.csrf.CsrfViewMiddleware",
"django.middleware.clickjacking.XFrameOptionsMiddleware",
"debug_toolbar.middleware.DebugToolbarMiddleware",
]
ROOT_URLCONF = "website.urls"
@ -73,3 +72,26 @@ USE_TZ = True
# https://docs.djangoproject.com/en/3.0/howto/static-files/
STATIC_URL = "/static/"
INTERNAL_IPS = [
"127.0.0.1",
"localhost",
]
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.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.panels.profiling.ProfilingPanel",
]
DEBUG_TOOLBAR_CONFIG = {"SHOW_COLLAPSED": True}

View file

@ -1,3 +1,8 @@
from django.urls import path
import debug_toolbar
from django.conf import settings
from django.urls import include, path
urlpatterns = []
if settings.DEBUG:
urlpatterns.append(path("__debug__/", include(debug_toolbar.urls)))