From d86855d5790677b5e01cf6e7d9706510cc65b658 Mon Sep 17 00:00:00 2001 From: jhyns Date: Wed, 17 May 2023 17:13:38 +0900 Subject: [PATCH] Add debug toolbar --- config/settings/local.py | 8 ++++++++ config/urls.py | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/config/settings/local.py b/config/settings/local.py index 4bb7094..def46a8 100644 --- a/config/settings/local.py +++ b/config/settings/local.py @@ -18,3 +18,11 @@ DATABASES = { "NAME": BASE_DIR / "db.sqlite3", } } + +# Debug toolbar + +INSTALLED_APPS += ["debug_toolbar"] + +MIDDLEWARE += ["debug_toolbar.middleware.DebugToolbarMiddleware"] + +INTERNAL_IPS = ["127.0.0.1"] diff --git a/config/urls.py b/config/urls.py index 1e3a4da..ee86e23 100644 --- a/config/urls.py +++ b/config/urls.py @@ -28,3 +28,8 @@ urlpatterns = ( + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) ) + +if settings.DEBUG: + import debug_toolbar + + urlpatterns += [path("__debug__/", include(debug_toolbar.urls))]