From d2674e92ab159105dabc004d01939eef5ab5f00a Mon Sep 17 00:00:00 2001 From: Hironsan Date: Thu, 24 Mar 2022 15:44:57 +0900 Subject: [PATCH] Add a setting for AWS --- backend/config/settings/aws.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 backend/config/settings/aws.py diff --git a/backend/config/settings/aws.py b/backend/config/settings/aws.py new file mode 100644 index 00000000..32157ec6 --- /dev/null +++ b/backend/config/settings/aws.py @@ -0,0 +1,16 @@ +import os + +from .base import * # noqa: F403 + +MIDDLEWARE.append("api.middleware.RangesMiddleware") # noqa: F405 +CORS_ORIGIN_WHITELIST = ("http://127.0.0.1:3000", "http://0.0.0.0:3000", "http://localhost:3000") +CSRF_TRUSTED_ORIGINS = CORS_ORIGIN_WHITELIST + +DJANGO_DRF_FILEPOND_STORAGES_BACKEND = "storages.backends.s3boto3.S3Boto3Storage" +AWS_ACCESS_KEY_ID = os.environ.get("AWS_ACCESS_KEY_ID") +AWS_SECRET_ACCESS_KEY = os.environ.get("AWS_SECRET_ACCESS_KEY") +AWS_S3_REGION_NAME = os.environ.get("REGION_NAME", "us-west-1") +AWS_STORAGE_BUCKET_NAME = os.environ.get("BUCKET_NAME", "filepond-uploads") +AWS_DEFAULT_ACL = "private" +AWS_BUCKET_ACL = "private" +AWS_AUTO_CREATE_BUCKET = True