File tree Expand file tree Collapse file tree 3 files changed +15
-4
lines changed Expand file tree Collapse file tree 3 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ def handle(self, **options):
17
17
)
18
18
19
19
# 1. (optional) Remove all objects from S3
20
- if "s3" in settings . DEFAULT_FILE_STORAGE :
20
+ if "s3" in default_storage . __class__ . __name__ . lower () :
21
21
self .stdout .write ("Removing files from S3" )
22
22
default_storage .bucket .objects .all ().delete ()
23
23
else :
Original file line number Diff line number Diff line change 182
182
MEDIA_ROOT = os .path .join (PROJECT_DIR , "media" )
183
183
MEDIA_URL = "/media/"
184
184
185
+ STORAGES = {
186
+ "default" : {
187
+ "BACKEND" : "django.core.files.storage.FileSystemStorage" ,
188
+ },
189
+ "staticfiles" : {
190
+ "BACKEND" : "django.contrib.staticfiles.storage.StaticFilesStorage" ,
191
+ },
192
+ }
193
+
185
194
# Override in local settings or replace with your own key. Please don't use our demo key in production!
186
195
GOOGLE_MAP_API_KEY = "AIzaSyD31CT9P9KxvNUJOwDq2kcFEIG8ADgaFgw"
187
196
Original file line number Diff line number Diff line change 141
141
# https://warehouse.python.org/project/whitenoise/
142
142
143
143
MIDDLEWARE .append ("whitenoise.middleware.WhiteNoiseMiddleware" )
144
- STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"
144
+ STORAGES ["staticfiles" ][
145
+ "BACKEND"
146
+ ] = "whitenoise.storage.CompressedManifestStaticFilesStorage"
145
147
146
148
if "AWS_STORAGE_BUCKET_NAME" in os .environ :
147
149
AWS_STORAGE_BUCKET_NAME = os .getenv ("AWS_STORAGE_BUCKET_NAME" )
148
150
AWS_QUERYSTRING_AUTH = False
149
151
INSTALLED_APPS .append ("storages" )
150
- DEFAULT_FILE_STORAGE = "storages.backends.s3boto3.S3Boto3Storage"
152
+ STORAGES [ "default" ][ "BACKEND" ] = "storages.backends.s3boto3.S3Boto3Storage"
151
153
AWS_S3_FILE_OVERWRITE = False
152
154
AWS_DEFAULT_ACL = "private"
153
155
if "AWS_S3_CUSTOM_DOMAIN" in os .environ :
162
164
GS_AUTO_CREATE_BUCKET = True
163
165
164
166
INSTALLED_APPS .append ("storages" )
165
- DEFAULT_FILE_STORAGE = "storages.backends.gcloud.GoogleCloudStorage"
167
+ STORAGES [ "default" ][ "BACKEND" ] = "storages.backends.gcloud.GoogleCloudStorage"
166
168
167
169
LOGGING = {
168
170
"version" : 1 ,
You can’t perform that action at this time.
0 commit comments