I have an S3 storage which is not hosted by AWS. I tried my AWS account as a file-storage, which worked fine, however, when I switch the credentials to the non-AWS provider I get:
botocore.exceptions.ClientError: An error occurred (403) when calling the HeadObject operation: Forbidden
in the django logs, and
ClientError at /admin/api/metabolomicsmzxml/add/ An error occurred (403) when calling the HeadObject operation: Forbidden
displayed in the browser.
I use django-storages with the following configuration:q :
AWS_ACCESS_KEY_ID = os.getenv('AWS_ACCESS_KEY_ID')
AWS_SECRET_ACCESS_KEY = os.getenv('AWS_SECRET_ACCESS_KEY')
AWS_STORAGE_BUCKET_NAME = os.getenv('AWS_STORAGE_BUCKET_NAME')
AWSS_S3_SIGNATURE_VERSION = 's3v4'
AWS_S3_REGION_NAME = 'ca-central-1'
AWS_S3_FILE_OVERWRITE = False
AWS_DEFAULT_ACL = None
AWS_S3_VERIFY = True
AWS_ENDPOINT_URL = 'example.com:443'
DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
Is it possible to use django-storages and boto3 with a non-AWS provider? Are there other packages that I should try?
I tried
AWS_S3_ENDPOINT_URL = 'example.com:443'
and
AWS_S3_ENDPOINT_URL = 'example.com'
then I get
ValueError: Invalid endpoint: ...