Properly disable silk when not in DEBUG and enable whitenoise only on prod

This commit is contained in:
Keannu Bernasol 2024-09-06 23:39:41 +08:00
parent 08f68c0b0a
commit d491590417

View file

@ -83,7 +83,7 @@ EMAIL_ADDRESS = (get_secret('EMAIL_ADDRESS') == 'True')
# Application definition # Application definition
INSTALLED_APPS = [ INSTALLED_APPS = [
'silk', 'silk' if DEBUG else None,
'config', 'config',
'unfold', 'unfold',
'unfold.contrib.filters', 'unfold.contrib.filters',
@ -118,7 +118,6 @@ INSTALLED_APPS = [
if DEBUG: if DEBUG:
MIDDLEWARE = [ MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware', 'django.middleware.security.SecurityMiddleware',
"whitenoise.middleware.WhiteNoiseMiddleware",
"silk.middleware.SilkyMiddleware", "silk.middleware.SilkyMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware", "django.contrib.sessions.middleware.SessionMiddleware",
"corsheaders.middleware.CorsMiddleware", "corsheaders.middleware.CorsMiddleware",