From 0427c3f5659622162687db1cc16009837e722e57 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Wed, 16 Feb 2022 23:01:11 -0500 Subject: [PATCH] Add config for debug_toolbar when in dev/DEBUG mode --- cmsmanage/settings/dev_base.py | 6 ++++++ cmsmanage/urls.py | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/cmsmanage/settings/dev_base.py b/cmsmanage/settings/dev_base.py index e8aab68..cdcab7a 100644 --- a/cmsmanage/settings/dev_base.py +++ b/cmsmanage/settings/dev_base.py @@ -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") diff --git a/cmsmanage/urls.py b/cmsmanage/urls.py index a9eb61a..99c2fa0 100644 --- a/cmsmanage/urls.py +++ b/cmsmanage/urls.py @@ -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")))