Changeset - 92a8613303cd
[Not reviewed]
0 1 0
Brett Smith - 4 years ago 2019-09-30 15:20:19
brettcsmith@brettcsmith.org
settings: Make root for dynamic storage configurable.
1 file changed with 8 insertions and 4 deletions:
0 comments (0 inline, 0 general)
pinaxcon/settings.py
Show inline comments
...
 
@@ -71,8 +71,4 @@ USE_L10N = True
 
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.
...
 
@@ -110,4 +106,12 @@ 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.
0 comments (0 inline, 0 general)