Skip to content

Commit

Permalink
Insert DebugToolbarMiddleware at correct place
Browse files Browse the repository at this point in the history
  • Loading branch information
friedelwolff committed Aug 1, 2024
1 parent 08f858b commit ee8a038
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@
MIDDLEWARE = [
"django.middleware.security.SecurityMiddleware",
"whitenoise.middleware.WhiteNoiseMiddleware",
# DebugToolbarMiddleware should go here if enabled. Done below. See
# https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#add-the-middleware
"django.contrib.sessions.middleware.SessionMiddleware",
"django.middleware.common.CommonMiddleware",
"django.middleware.csrf.CsrfViewMiddleware",
Expand All @@ -77,7 +79,7 @@

# Add debug toolbar middleware
if DEBUG and DEBUG_TOOLBAR:
MIDDLEWARE.insert(0, "debug_toolbar.middleware.DebugToolbarMiddleware")
MIDDLEWARE.insert(2, "debug_toolbar.middleware.DebugToolbarMiddleware")

ROOT_URLCONF = "app.urls"

Expand Down

0 comments on commit ee8a038

Please sign in to comment.