Commit e801fa8 1 parent 954f3cd commit e801fa8 Copy full SHA for e801fa8
File tree 1 file changed +14
-3
lines changed
museum_of_dreams_project/settings
1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change 1
1
from .base import *
2
+ from storages .backends .s3boto3 import S3Boto3Storage
3
+
2
4
3
5
SECRET_KEY = os .environ .get ("SECRET_KEY" )
4
6
28
30
AWS_QUERYSTRING_AUTH = False # needed by grappelli to work with s3
29
31
30
32
31
- # DEFAULT_FILE_STORAGE = "storages.backends.s3boto3.S3Boto3Storage"
32
- STATICFILES_STORAGE = "storages.backends.s3boto3.S3Boto3Storage"
33
+ class StaticStorage (S3Boto3Storage ):
34
+ location = STATIC_ROOT
35
+
36
+
37
+ class MediaStorage (S3Boto3Storage ):
38
+ location = MEDIA_ROOT
39
+
40
+
41
+ DEFAULT_FILE_STORAGE = "MediaStorage"
42
+ STATICFILES_STORAGE = "StaticStorage"
33
43
34
44
AWS_ACCESS_KEY_ID = os .environ ["AWS_ACCESS_KEY_ID" ]
35
45
AWS_SECRET_ACCESS_KEY = os .environ ["AWS_SECRET_ACCESS_KEY" ]
38
48
AWS_S3_CUSTOM_DOMAIN = (
39
49
f"{ AWS_STORAGE_BUCKET_NAME } .s3.{ AWS_S3_REGION_NAME } .amazonaws.com"
40
50
)
41
- STATIC_URL = "https://%s/" % AWS_S3_CUSTOM_DOMAIN
51
+ STATIC_URL = "https://%s/static" % AWS_S3_CUSTOM_DOMAIN
52
+ MEDIA_URL = "https://%s/media" % AWS_S3_CUSTOM_DOMAIN
You can’t perform that action at this time.
0 commit comments