diff --git a/pinaxcon/settings.py b/pinaxcon/settings.py index 3a91070a09cdeacffe3a6566384af4a62ad6e170..73f5d088a61c65aa19ad81929c168dcfc14c3df5 100644 --- a/pinaxcon/settings.py +++ b/pinaxcon/settings.py @@ -70,10 +70,6 @@ USE_L10N = True # If you set this to False, Django will not use timezone-aware datetimes. USE_TZ = True -# Absolute filesystem path to the directory that will hold user-uploaded files. -# Example: "/home/media/media.lawrence.com/media/" -MEDIA_ROOT = os.path.join(PACKAGE_ROOT, "site_media", "media") - # URL that handles the media served from MEDIA_ROOT. Make sure to use a # trailing slash. # Examples: "http://media.lawrence.com/media/", "http://example.com/media/" @@ -109,6 +105,14 @@ AWS_ACCESS_KEY_ID = os.environ.get("DJANGO_AWS_ACCESS_KEY_ID", None) AWS_SECRET_ACCESS_KEY = os.environ.get("DJANGO_AWS_SECRET_ACCESS_KEY", None) AWS_STORAGE_BUCKET_NAME = os.environ.get("DJANGO_AWS_STORAGE_BUCKET_NAME", None) +try: + _dynamic_storage_root = os.environ['DJANGO_DYNAMIC_STORAGE_ROOT'] +except KeyError: + # Absolute filesystem path to the directory that will hold user-uploaded files. + MEDIA_ROOT = os.path.join(PACKAGE_ROOT, "site_media", "media") +else: + MEDIA_ROOT = os.path.join(_dynamic_storage_root, "user_upload") + COMPRESS_ROOT = _dynamic_storage_root # Make this unique, and don't share it with anybody. SECRET_KEY = os.environ.get('DJANGO_SECRET_KEY', '').strip()