Skip to content

Commit 246302a

Browse files
Merge pull request #54 from fromedwin/develop
Define storage for static files
2 parents 9d0f7f8 + 296631e commit 246302a

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
AWS_S3_FILE_OVERWRITE = True
9898
STATIC_ROOT = os.path.join(BASE_DIR, 'collectstatic')
9999
# s3 static settings
100-
STATICFILES_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
100+
STATICFILES_STORAGE = 'core.storage_backends.StaticStorage'
101101
STATIC_URL = f'https://{AWS_S3_CUSTOM_DOMAIN}/static/'
102102
DEFAULT_FILE_STORAGE = 'core.storage_backends.MediaStorage'
103103
MEDIA_URL = f'https://{AWS_S3_CUSTOM_DOMAIN}/media/'

src/core/storage_backends.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,8 @@
22

33
class MediaStorage(S3Boto3Storage):
44
location = 'media'
5-
file_overwrite = False
5+
file_overwrite = True
6+
7+
class StaticStorage(S3Boto3Storage):
8+
location = 'static'
9+
file_overwrite = True

0 commit comments

Comments
 (0)