Skip to content

Commit ca767c8

Browse files
committed
STORAGES 정의 추가
1 parent 76415eb commit ca767c8

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

pyconweb2022/pyconweb2022/settings.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,17 @@
134134
STATIC_URL = "static/"
135135

136136
# S3
137-
DEFAULT_FILE_STORAGE = (
138-
"pyconweb2022.customBoto3Storage.SecurityTokenWorkaroundS3Boto3Storage"
139-
)
140-
STATICFILES_STORAGE = "storages.backends.s3boto3.S3StaticStorage"
137+
DEFAULT_FILE_STORAGE = DEFAULT_STORAGE_BACKEND = "pyconweb2022.customBoto3Storage.SecurityTokenWorkaroundS3Boto3Storage"
138+
STATICFILES_STORAGE = STATIC_STORAGE_BACKEND = "storages.backends.s3boto3.S3StaticStorage"
139+
141140
AWS_S3_SESSION_PROFILE = "pycon"
142141
AWS_STORAGE_BUCKET_NAME = os.getenv("AWS_STATIC_S3_BUCKET")
143142

143+
STORAGES = {
144+
"default": {"BACKEND": DEFAULT_STORAGE_BACKEND, "OPTIONS": {"bucket_name": AWS_STORAGE_BUCKET_NAME}},
145+
"staticfiles": {"BACKEND": STATIC_STORAGE_BACKEND, "OPTIONS": {"bucket_name": AWS_STORAGE_BUCKET_NAME}},
146+
}
147+
144148
# Default primary key field type
145149
# https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field
146150

0 commit comments

Comments
 (0)