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
...
 
@@ -72,6 +72,2 @@ 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
...
 
@@ -111,2 +107,10 @@ 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
 

	
0 comments (0 inline, 0 general)