From d49159041778d45d4ef48f687dd18d184799ed95 Mon Sep 17 00:00:00 2001 From: Keannu Bernasol Date: Fri, 6 Sep 2024 23:39:41 +0800 Subject: [PATCH] Properly disable silk when not in DEBUG and enable whitenoise only on prod --- backend/config/settings.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/backend/config/settings.py b/backend/config/settings.py index d9de5e0..034d3b4 100644 --- a/backend/config/settings.py +++ b/backend/config/settings.py @@ -83,7 +83,7 @@ EMAIL_ADDRESS = (get_secret('EMAIL_ADDRESS') == 'True') # Application definition INSTALLED_APPS = [ - 'silk', + 'silk' if DEBUG else None, 'config', 'unfold', 'unfold.contrib.filters', @@ -118,7 +118,6 @@ INSTALLED_APPS = [ if DEBUG: MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', - "whitenoise.middleware.WhiteNoiseMiddleware", "silk.middleware.SilkyMiddleware", "django.contrib.sessions.middleware.SessionMiddleware", "corsheaders.middleware.CorsMiddleware",