From dbdff7655bbea40263d01dada05e44b7683dc097 Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Mon, 30 Jan 2023 21:13:47 +0100 Subject: [PATCH] Fix debug toolbar middleware position --- src/blog/settings.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/blog/settings.py b/src/blog/settings.py index 69461a8..a7edece 100644 --- a/src/blog/settings.py +++ b/src/blog/settings.py @@ -118,7 +118,8 @@ MIDDLEWARE = [ "csp.middleware.CSPMiddleware", ] if DEBUG: - MIDDLEWARE.insert(0, "debug_toolbar.middleware.DebugToolbarMiddleware") + index = MIDDLEWARE.index("django.middleware.gzip.GZipMiddleware") + 1 + MIDDLEWARE.insert(index, "debug_toolbar.middleware.DebugToolbarMiddleware") ROOT_URLCONF = "blog.urls"