From ded6dbcb87914bc00cf67ed04e0520324ad6ab33 Mon Sep 17 00:00:00 2001 From: Arkadiy Kukarkin Date: Tue, 11 Jun 2024 07:12:44 -0400 Subject: [PATCH] Allow specifying endpoint url for S3 --- django_distill/backends/amazon_s3.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/django_distill/backends/amazon_s3.py b/django_distill/backends/amazon_s3.py index d48c206..6f59e40 100644 --- a/django_distill/backends/amazon_s3.py +++ b/django_distill/backends/amazon_s3.py @@ -34,10 +34,12 @@ def account_container(self): def authenticate(self, calling_format=None): access_key_id = self.account_username() secret_access_key = self.options.get('SECRET_ACCESS_KEY', '') + endpoint_url = self.options.get('ENDPOINT_URL', '') bucket = self.account_container() if access_key_id and secret_access_key: self.d['connection'] = boto3.client('s3', aws_access_key_id=access_key_id, - aws_secret_access_key=secret_access_key) + aws_secret_access_key=secret_access_key, + endpoint_url=endpoint_url) else: self.d['connection'] = boto3.client('s3') self.d['bucket'] = bucket