Skip to content

Commit 4594e2a

Browse files
authored
Merge pull request #8 from pythonkr/feature/static
fix: static URL s3 설정 변경
2 parents 5ba1a08 + d9bf38d commit 4594e2a

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

app/core/settings.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,12 +269,18 @@
269269
# Static files (CSS, JavaScript, Images)
270270
# https://docs.djangoproject.com/en/5.2/howto/static-files/
271271
STATIC_ROOT = BASE_DIR / "static"
272-
STATIC_URL = "static/"
273272

274273
DEFAULT_STORAGE_BACKEND = env("DJANGO_DEFAULT_STORAGE_BACKEND", default="storages.backends.s3.S3Storage")
275274
STATIC_STORAGE_BACKEND = env("DJANGO_STATIC_STORAGE_BACKEND", default="storages.backends.s3.S3Storage")
276275

277276
STORAGE_BUCKET_NAME = f"pyconkr-backend-{API_STAGE}"
277+
278+
STATIC_URL = (
279+
f"https://{STORAGE_BUCKET_NAME}.s3.amazonaws.com/"
280+
if STATIC_STORAGE_BACKEND == "storages.backends.s3.S3Storage"
281+
else "static/"
282+
)
283+
278284
STORAGE_OPTIONS = (
279285
{
280286
"bucket_name": STORAGE_BUCKET_NAME,

0 commit comments

Comments
 (0)