From 30832597ff318420a4bb96ade59d159420a6f40a Mon Sep 17 00:00:00 2001 From: "madjid.asa" Date: Thu, 25 Jul 2024 15:47:56 +0200 Subject: [PATCH] try to add config for s3 --- config/settings/staging.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/config/settings/staging.py b/config/settings/staging.py index 6e905d009..c576bae89 100644 --- a/config/settings/staging.py +++ b/config/settings/staging.py @@ -7,6 +7,22 @@ env = environ.Env() +STORAGES = { + "default": { + "BACKEND": "lemarche.utils.s3boto.S3BotoStorage", + "OPTIONS": { + "bucket_name": S3_STORAGE_BUCKET_NAME, # noqa + "access_key": S3_STORAGE_ACCESS_KEY_ID, # noqa + "secret_key": S3_STORAGE_SECRET_ACCESS_KEY, # noqa + "endpoint_url": f"https://{S3_STORAGE_ENDPOINT_DOMAIN}", # noqa + "region_name": S3_STORAGE_BUCKET_REGION, # noqa + "file_overwrite": False, + "location": env.str("S3_LOCATION", ""), + }, + } +} + + ALLOWED_HOSTS = [ "127.0.0.1", "staging.inclusion.beta.gouv.fr", @@ -24,7 +40,7 @@ SECURE_SSL_REDIRECT = env.bool("SECURE_SSL_REDIRECT", True) MEDIA_URL = f"https://{S3_STORAGE_ENDPOINT_DOMAIN}/" # noqa -DEFAULT_FILE_STORAGE = "lemarche.utils.s3boto.S3BotoStorage" +# DEFAULT_FILE_STORAGE = "lemarche.utils.s3boto.S3BotoStorage" # Sentry