From 9ea107cb5591a1691ca9e161d92aa4f35ce7cdba Mon Sep 17 00:00:00 2001 From: yujeong Date: Sun, 6 Oct 2024 16:09:13 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20weaverse/settings.py=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - AWS S3 스토리지 설정 추가 --- weaverse/settings.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/weaverse/settings.py b/weaverse/settings.py index adf14f7..3ba8b1e 100644 --- a/weaverse/settings.py +++ b/weaverse/settings.py @@ -135,3 +135,15 @@ "SERVE_URLCONF": "weaverse.urls", "EXTERNAL_DOCS": {"description": "Weaverse GitHub", "url": ""}, } + +# S3 설정 +AWS_ACCESS_KEY_ID = os.getenv("AWS_ACCESS_KEY_ID") +AWS_SECRET_ACCESS_KEY = os.getenv("AWS_SECRET_ACCESS_KEY") +AWS_STORAGE_BUCKET_NAME = os.getenv("AWS_STORAGE_BUCKET_NAME") +AWS_S3_REGION_NAME = os.getenv("AWS_S3_REGION_NAME") +AWS_S3_CUSTOM_DOMAIN = f"{AWS_STORAGE_BUCKET_NAME}.s3.amazonaws.com" +AWS_S3_OBJECT_PARAMETERS = { + "CacheControl": "max-age=86400", +} + +DEFAULT_FILE_STORAGE = "storages.backends.s3boto3.S3Boto3Storage"