diff --git a/requirements-dev.txt b/requirements-dev.txt index c22fbe2..c738c71 100644 Binary files a/requirements-dev.txt and b/requirements-dev.txt differ diff --git a/savepointradio/savepointradio/settings.py b/savepointradio/savepointradio/settings.py index 7890b5b..ac45c4b 100644 --- a/savepointradio/savepointradio/settings.py +++ b/savepointradio/savepointradio/settings.py @@ -152,6 +152,24 @@ AXES_META_PRECEDENCE_ORDER = [ AXES_PROXY_COUNT = 1 +# +# Django Debug Toolbar settings +# + +DEBUG_TOOLBAR_ENABLED = config( + 'DEBUG_TOOLBAR_ENABLED', + default=False, + cast=bool +) + +INTERNAL_IPS = [ + '127.0.0.1', +] + +if DEBUG_TOOLBAR_ENABLED: + INSTALLED_APPS.append('debug_toolbar') + MIDDLEWARE.insert(0, 'debug_toolbar.middleware.DebugToolbarMiddleware') + # # Django Rest Framework settings # diff --git a/savepointradio/savepointradio/urls.py b/savepointradio/savepointradio/urls.py index 1e1118c..b2ed2c7 100644 --- a/savepointradio/savepointradio/urls.py +++ b/savepointradio/savepointradio/urls.py @@ -1,3 +1,4 @@ +from django.conf import settings from django.contrib import admin from django.urls import include, path @@ -5,3 +6,9 @@ urlpatterns = [ path('admin/', admin.site.urls), path('api/', include('api.urls')), ] + +if settings.DEBUG and settings.DEBUG_TOOLBAR_ENABLED: + import debug_toolbar + urlpatterns = [ + path('__debug__/', include(debug_toolbar.urls)), + ] + urlpatterns