1
Fork 0

Opt-in to DDT

This commit is contained in:
Jake Howard 2024-05-24 21:41:53 +01:00
parent eb4e1ad198
commit 9301f295cc
Signed by: jake
GPG key ID: 57AFB45680EDD477
2 changed files with 9 additions and 4 deletions

View file

@ -34,14 +34,12 @@ ALLOWED_HOSTS = ["*"]
INSTALLED_APPS = [
'django.contrib.staticfiles',
"yamdl_playground.core",
"yamdl",
"debug_toolbar"
"yamdl"
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.middleware.common.CommonMiddleware',
"debug_toolbar.middleware.DebugToolbarMiddleware",
'django.middleware.csrf.CsrfViewMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
@ -214,3 +212,8 @@ if "ENABLE_ADMIN" in os.environ:
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
])
if "ENABLE_DDT" in os.environ:
INSTALLED_APPS.append("debug_toolbar")
MIDDLEWARE.append("debug_toolbar.middleware.DebugToolbarMiddleware")

View file

@ -21,7 +21,6 @@ from django.apps import apps
urlpatterns = [
path("search/", views.search),
path("content/<slug:slug>/", views.content),
path("__debug__/", include("debug_toolbar.urls")),
path("cached-content/<slug:slug>/", views.cached_content)
]
@ -29,3 +28,6 @@ if apps.is_installed("django.contrib.admin"):
from django.contrib import admin
urlpatterns.append(path("admin/", admin.site.urls))
if apps.is_installed("debug_toolbar"):
urlpatterns.append(path("__debug__/", include("debug_toolbar.urls")))