Skip to content

Commit

Permalink
Configure Django debug toolbar
Browse files Browse the repository at this point in the history
  • Loading branch information
brylie committed Jan 9, 2024
1 parent 5ec7f6e commit cc2bc24
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
11 changes: 11 additions & 0 deletions core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
default=True,
)

INTERNAL_IPS = [
"127.0.0.1",
]

ALLOWED_HOSTS = env.list(
"DJANGO_ALLOWED_HOSTS",
default=[
Expand All @@ -56,6 +60,7 @@
"django.contrib.staticfiles",
"crispy_forms",
"crispy_bootstrap5",
"debug_toolbar",
"accounts",
"activities",
"caregivers",
Expand All @@ -71,6 +76,12 @@
CRISPY_TEMPLATE_PACK = "bootstrap5"

MIDDLEWARE = [
# The order of MIDDLEWARE is important.
# Include the Debug Toolbar middleware as early as possible in the list.
# However, it must come after any other middleware that encodes
# the response’s content, such as GZipMiddleware.
# https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#add-the-middleware
"debug_toolbar.middleware.DebugToolbarMiddleware",
"django.middleware.security.SecurityMiddleware",
"whitenoise.middleware.WhiteNoiseMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
Expand Down
12 changes: 11 additions & 1 deletion core/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
from django.views.generic.base import TemplateView

urlpatterns = [
path(
"__debug__/",
include("debug_toolbar.urls"),
),
path("admin/", admin.site.urls),
path(
"i18n/",
Expand Down Expand Up @@ -47,5 +51,11 @@
"work/",
include("work.urls"),
),
path("", TemplateView.as_view(template_name="home.html"), name="home"),
path(
"",
TemplateView.as_view(
template_name="home.html",
),
name="home",
),
]

0 comments on commit cc2bc24

Please sign in to comment.