Skip to content

Commit

Permalink
Merge pull request cfpb#2286 from cfpb/add-media-root-env-var
Browse files Browse the repository at this point in the history
Allow MEDIA_ROOT to be set by environment
  • Loading branch information
willbarton authored Aug 10, 2016
2 parents 192228b + fc29b9b commit 6d57fbb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .env_SAMPLE
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ export DJANGO_STAGING_HOSTNAME='content.localhost'
#export DJANGO_STATIC_ROOT=<path_to_static_files>
export DJANGO_HTTP_PORT=8000

##################################
# Django Media Storage (optional).
##################################

# export MEDIA_ROOT=<path_to_media_root>

#############################################
# V1 - application feature related variables.
#############################################
Expand Down
3 changes: 2 additions & 1 deletion cfgov/cfgov/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6d57fbb

Please sign in to comment.