Commit 022deaf3 authored by Evili del Rio's avatar Evili del Rio

Correct MIDDLEWARE setting for WhiteNoise

parent d6a08e29
Pipeline #637 failed with stages
in 44 seconds
...@@ -83,14 +83,14 @@ if not('health_ceck' in INSTALLED_APPS): ...@@ -83,14 +83,14 @@ if not('health_ceck' in INSTALLED_APPS):
# Add whitenoise to MIDDLEWARE_CLASSES if needed # Add whitenoise to MIDDLEWARE_CLASSES if needed
# and set STATICFILES_STORAGE # and set STATICFILES_STORAGE
# #
if not('whitenoise.middleware.WhiteNoiseMiddleware' in MIDDLEWARE_CLASSES): if not('whitenoise.middleware.WhiteNoiseMiddleware' in MIDDLEWARE):
try: try:
__sec_index = MIDDLEWARE_CLASSES.index('django.middleware.security.SecurityMiddleware') __sec_index = MIDDLEWARE.index('django.middleware.security.SecurityMiddleware')
except ValueError: except ValueError:
# if no 'django...SecurityMiddleware' (!) put whitenoise first. # if no 'django...SecurityMiddleware' (!) put whitenoise first.
__sec_index = -1 __sec_index = -1
MIDDLEWARE_CLASSES.insert(__sec_index+1, 'whitenoise.middleware.WhiteNoiseMiddleware') MIDDLEWARE.insert(__sec_index+1, 'whitenoise.middleware.WhiteNoiseMiddleware')
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage' STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment