Skip to content

Commit

Permalink
Add DEBUG_TOOLBAR_ENABLED setting. (#1669)
Browse files Browse the repository at this point in the history
  • Loading branch information
valberg authored Sep 30, 2024
1 parent e8445bf commit 9a9617a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/bornhack/environment_settings.py.dist
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ DATABASES = {
}

DEBUG={{ django_debug }}
DEBUG_TOOLBAR_ENABLED={{ django_debug_toolbar_enabled }}


# start redirecting to the next camp instead of the previous camp after
Expand Down
1 change: 1 addition & 0 deletions src/bornhack/environment_settings.py.dist.dev
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ DATABASES = {
}
}
DEBUG = True
DEBUG_TOOLBAR_ENABLED = DEBUG
CHANNEL_LAYERS = {}

ASGI_APPLICATION = "bornhack.routing.application"
Expand Down
2 changes: 1 addition & 1 deletion src/bornhack/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
CORS_ORIGIN_ALLOW_ALL = True
CORS_URLS_REGEX = r"^/api/*$"

if DEBUG: # noqa: F405
if DEBUG_TOOLBAR_ENABLED: # noqa: F405
EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"
INSTALLED_APPS += ["debug_toolbar"]
MIDDLEWARE = ["debug_toolbar.middleware.DebugToolbarMiddleware"] + MIDDLEWARE
Expand Down
2 changes: 1 addition & 1 deletion src/bornhack/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@
),
]

if settings.DEBUG:
if settings.DEBUG_TOOLBAR_ENABLED:
import debug_toolbar

urlpatterns = [path("__debug__/", include(debug_toolbar.urls))] + urlpatterns

0 comments on commit 9a9617a

Please sign in to comment.