Skip to content

Commit

Permalink
Re-migrates django-storages[s3] new syntax for django 5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mrharpo committed Nov 6, 2024
1 parent 9cd3276 commit 33ae34a
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions ov_wag/settings/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,20 @@
AWS_STORAGE_BUCKET_NAME = env.get('AWS_STORAGE_BUCKET_NAME')
AWS_ACCESS_KEY_ID = env.get('AWS_ACCESS_KEY_ID')
AWS_SECRET_ACCESS_KEY = env.get('AWS_SECRET_ACCESS_KEY')
MEDIA_URL = f'https://s3.amazonaws.com/{AWS_STORAGE_BUCKET_NAME}/'
DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
AWS_S3_FILE_OVERWRITE = False
AWS_S3_SIGNATURE_VERSION = 's3v4'
AWS_QUERYSTRING_AUTH = True

STORAGES = {
'default': {
'BACKEND': 'storages.backends.s3.S3Storage',
'OPTIONS': {},
},
'staticfiles': {
'BACKEND': 'storages.backends.s3.S3Storage',
'OPTIONS': {
'location': 'static',
},
},
}

with suppress(ImportError):
from .local import * # noqa F403

0 comments on commit 33ae34a

Please sign in to comment.