I'm trying to configure Django Storages with authentication on eu-south-2
I'm receiving this error with status code 400
<Error><Code>IllegalLocationConstraintException</Code><Message>The eu-south-2 location constraint is incompatible for the region specific endpoint this request was sent to.</Message>...</Error>
My Django setup & config:
requirements.txt
Django==4.2.3
boto3==1.34.55
django-storages==1.14.2
settings.py:
AWS_ACCESS_KEY_ID = os.environ.get("AWS_S3_ACCESS_KEY_ID", None)
AWS_SECRET_ACCESS_KEY = os.environ.get("AWS_S3_SECRET_ACCESS_KEY", None)
AWS_DEFAULT_REGION = os.environ.get("AWS_DEFAULT_REGION", None) # value eu-south-2
AWS_S3_REGION_NAME = AWS_DEFAULT_REGION
AWS_STORAGE_BUCKET_NAME = os.environ.get("AWS_STORAGE_BUCKET_NAME", None)
AWS_QUERYSTRING_AUTH = True
AWS_S3_DOMAIN = f"{AWS_STORAGE_BUCKET_NAME}.s3.{AWS_DEFAULT_REGION}.amazonaws.com"
AWS_S3_SIGNATURE_VERSION = "s3v4"
AWS_S3_OBJECT_PARAMETERS = {"CacheControl": "max-age=86400"}
STORAGES = {
"default" = {
"BACKEND": "storages.backends.s3boto3.S3Boto3Storage"
}
}