diff --git a/crm/views/seller_views.py b/crm/views/seller_views.py index 5122422..8f5ff0a 100644 --- a/crm/views/seller_views.py +++ b/crm/views/seller_views.py @@ -235,12 +235,15 @@ def preview_document(request): if aws_access and aws_secret: try: import boto3 + from botocore.client import Config from django.shortcuts import redirect s3_client = boto3.client( 's3', aws_access_key_id=aws_access, aws_secret_access_key=aws_secret, - region_name=os.environ.get('AWS_REGION', 'ap-south-2') + region_name=os.environ.get('AWS_REGION', 'ap-south-2'), + endpoint_url=f"https://s3.{os.environ.get('AWS_REGION', 'ap-south-2')}.amazonaws.com", + config=Config(signature_version='s3v4') ) presigned_url = s3_client.generate_presigned_url( 'get_object',