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
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",