Add config for debug_toolbar when in dev/DEBUG mode

This commit is contained in:
Adam Goldsmith 2022-02-16 23:01:11 -05:00
parent ff723e019d
commit 0427c3f565
2 changed files with 10 additions and 0 deletions

View File

@ -5,3 +5,9 @@ from .base import *
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
INTERNAL_IPS = ["127.0.0.1"]
INSTALLED_APPS.append("debug_toolbar")
MIDDLEWARE.insert(0, "debug_toolbar.middleware.DebugToolbarMiddleware")

View File

@ -17,6 +17,7 @@ from django.contrib import admin
from django.shortcuts import redirect
from django.urls import include, path
from django.contrib.auth.views import LoginView, LogoutView
from django.conf import settings
urlpatterns = [
@ -47,3 +48,6 @@ urlpatterns = [
),
path("markdownx/", include("markdownx.urls")),
]
if settings.DEBUG:
urlpatterns.append(path("__debug__/", include("debug_toolbar.urls")))