diff --git a/src/core/settings.py b/src/core/settings.py index c6a9de7..2a7b9f0 100644 --- a/src/core/settings.py +++ b/src/core/settings.py @@ -97,7 +97,7 @@ AWS_S3_FILE_OVERWRITE = True STATIC_ROOT = os.path.join(BASE_DIR, 'collectstatic') # s3 static settings - STATICFILES_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage' + STATICFILES_STORAGE = 'core.storage_backends.StaticStorage' STATIC_URL = f'https://{AWS_S3_CUSTOM_DOMAIN}/static/' DEFAULT_FILE_STORAGE = 'core.storage_backends.MediaStorage' MEDIA_URL = f'https://{AWS_S3_CUSTOM_DOMAIN}/media/' diff --git a/src/core/storage_backends.py b/src/core/storage_backends.py index b411648..a9183d1 100644 --- a/src/core/storage_backends.py +++ b/src/core/storage_backends.py @@ -2,4 +2,8 @@ class MediaStorage(S3Boto3Storage): location = 'media' - file_overwrite = False + file_overwrite = True + +class StaticStorage(S3Boto3Storage): + location = 'static' + file_overwrite = True