Commit d6a08e29 authored by Evili del Rio's avatar Evili del Rio

Add withenoise to environment_settings and use it.

parent a7aecc5d
Pipeline #635 failed with stages
in 46 seconds
......@@ -72,12 +72,28 @@ if os.getenv('DJANGO_DATABASES', None) is None:
#
# Add django-health-check to INSTALLED_APPS
#
INSTALLED_APPS.extend([
if not('health_ceck' in INSTALLED_APPS):
INSTALLED_APPS.extend([
'health_check',
'health_check.db',
'health_check.cache',
'health_check.storage',
])
])
#
# Add whitenoise to MIDDLEWARE_CLASSES if needed
# and set STATICFILES_STORAGE
#
if not('whitenoise.middleware.WhiteNoiseMiddleware' in MIDDLEWARE_CLASSES):
try:
__sec_index = MIDDLEWARE_CLASSES.index('django.middleware.security.SecurityMiddleware')
except ValueError:
# if no 'django...SecurityMiddleware' (!) put whitenoise first.
__sec_index = -1
MIDDLEWARE_CLASSES.insert(__sec_index+1, 'whitenoise.middleware.WhiteNoiseMiddleware')
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
#
# Substitue ROOT_URLCONF to include health checks
#
......
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