From 6586b65b263e10e450b3d58d6fc984e9f553eacb Mon Sep 17 00:00:00 2001 From: Will Barton Date: Fri, 5 Aug 2016 15:45:41 -0400 Subject: [PATCH] Allow MEDIA_ROOT to be set by env var --- .env_SAMPLE | 6 ++++++ cfgov/cfgov/settings/base.py | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.env_SAMPLE b/.env_SAMPLE index 36dc18843e0..7e1c1ce411c 100755 --- a/.env_SAMPLE +++ b/.env_SAMPLE @@ -11,6 +11,12 @@ export DJANGO_STAGING_HOSTNAME='content.localhost' #export DJANGO_STATIC_ROOT= export DJANGO_HTTP_PORT=8000 +################################## +# Django Media Storage (optional). +################################## + +# export MEDIA_ROOT= + ############################################# # V1 - application feature related variables. ############################################# diff --git a/cfgov/cfgov/settings/base.py b/cfgov/cfgov/settings/base.py index f6dfe6a45f3..4cdab33ee6a 100644 --- a/cfgov/cfgov/settings/base.py +++ b/cfgov/cfgov/settings/base.py @@ -177,7 +177,8 @@ # Absolute path to the directory static files should be collected to. STATIC_ROOT = os.environ.get('DJANGO_STATIC_ROOT', '/var/www/html/static') -MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'f') +MEDIA_ROOT = os.environ.get('MEDIA_ROOT', + os.path.join(PROJECT_ROOT, 'f')) MEDIA_URL = '/f/' # List of finder classes that know how to find static files in