diff --git a/speed_python/cabotage_settings.py b/speed_python/cabotage_settings.py index 5d74a33f..a0b06cea 100644 --- a/speed_python/cabotage_settings.py +++ b/speed_python/cabotage_settings.py @@ -34,6 +34,9 @@ COMPRESS_ENABLED = True +MIDDLEWARE = MIDDLEWARE + ['whitenoise.middleware.WhiteNoiseMiddleware'] +STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage" + _DATA_ROOT = os.environ.get("DJANGO_DATA_ROOT", "/srv/data") MEDIA_ROOT = _DATA_ROOT + "/media" STATIC_ROOT = _DATA_ROOT + "/site_media/static" diff --git a/speed_python/settings.py b/speed_python/settings.py index fb2276b2..1b5235f1 100644 --- a/speed_python/settings.py +++ b/speed_python/settings.py @@ -41,21 +41,19 @@ # XXX Set SECRET_KEY in local_settings.py #with open(os.path.join(BASEDIR, 'secret_key')) as f: # SECRET_KEY = f.read().strip() -SECRET_KEY = os.environ.get("DJANGO_SECRET_KEY") TEMPLATE_LOADERS = ( 'django.template.loaders.filesystem.Loader', 'django.template.loaders.app_directories.Loader', ) -MIDDLEWARE = ( +MIDDLEWARE = [ 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', - 'whitenoise.middleware.WhiteNoiseMiddleware', -) +] if DEBUG: import traceback @@ -116,7 +114,11 @@ def process_exception(self, request, exception): STATICFILES_DIRS = ( os.path.join(BASEDIR, 'static'), ) -STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage" # Codespeed settings that can be overwritten here. from codespeed.settings import * + +try: + from .local_settings import * +except ImportError: + pass