Skip to content

Commit

Permalink
Add support for MEDIA_ROOT and STATIC_ROOT
Browse files Browse the repository at this point in the history
  • Loading branch information
apragacz committed Nov 30, 2022
1 parent 821a762 commit d413cec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fzw/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,15 +204,15 @@ def aws_media_url(s3_bucket_name, cloudfront_domain):


STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(DATA_DIR, 'assets')
STATIC_ROOT = os.environ.get('STATIC_ROOT', os.path.join(DATA_DIR, 'assets'))

if USE_S3 and FZW_MEDIA_S3_BUCKET:
MEDIA_URL = aws_media_url(FZW_MEDIA_S3_BUCKET, FZW_MEDIA_CLOUDFRONT_DOMAIN)
MEDIA_ROOT = None
DEFAULT_FILE_STORAGE = 'fzw.storage_backends.MediaStorage'
else:
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(DATA_DIR, 'media')
MEDIA_ROOT = os.environ.get('MEDIA_ROOT', os.path.join(DATA_DIR, 'media'))

FZW_DEFAULT_NUM_OF_QUIZ_QUESTIONS = int(os.environ.get(
'FZW_DEFAULT_NUM_OF_QUIZ_QUESTIONS', 16))

0 comments on commit d413cec

Please sign in to comment.