From 1b1606c3a4af4d105fb08c19e4ea1ceb5b681702 Mon Sep 17 00:00:00 2001 From: vincent porte Date: Thu, 19 Dec 2024 15:11:19 +0100 Subject: [PATCH] make bucket name dynamical in migration file --- lacommunaute/partner/migrations/0001_initial.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lacommunaute/partner/migrations/0001_initial.py b/lacommunaute/partner/migrations/0001_initial.py index b3d76e2df..755293e94 100644 --- a/lacommunaute/partner/migrations/0001_initial.py +++ b/lacommunaute/partner/migrations/0001_initial.py @@ -2,6 +2,7 @@ import machina.models.fields import storages.backends.s3 +from django.conf import settings from django.db import migrations, models import lacommunaute.utils.validators @@ -35,7 +36,9 @@ class Migration(migrations.Migration): "logo", models.ImageField( help_text="1200x600 recommandé", - storage=storages.backends.s3.S3Storage(bucket_name="private-bucket", file_overwrite=False), + storage=storages.backends.s3.S3Storage( + bucket_name=settings.AWS_STORAGE_BUCKET_NAME, file_overwrite=False + ), upload_to="logos/", validators=[lacommunaute.utils.validators.validate_image_size], ),