Add support for other S3-like providers (#476)

This commit is contained in:
Jean-Louis Jouannic 2022-06-06 22:34:22 +02:00 committed by GitHub
parent a75e000af6
commit f6960dc2e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View File

@ -227,6 +227,8 @@ AWS_ACCESS_KEY_ID = os.environ.get("AWS_ACCESS_KEY_ID") or None
AWS_SECRET_ACCESS_KEY = os.environ.get("AWS_SECRET_ACCESS_KEY") or None AWS_SECRET_ACCESS_KEY = os.environ.get("AWS_SECRET_ACCESS_KEY") or None
AWS_S3_ENDPOINT_URL = os.environ.get("AWS_S3_ENDPOINT_URL") or None
if AWS_STORAGE_BUCKET_NAME: if AWS_STORAGE_BUCKET_NAME:
DEFAULT_FILE_STORAGE = "storages.backends.s3boto3.S3Boto3Storage" DEFAULT_FILE_STORAGE = "storages.backends.s3boto3.S3Boto3Storage"

View File

@ -57,6 +57,13 @@ If you would like to use AWS S3 for storage on ephemeral storage platforms like
Heroku you will need to create a bucket and add its name. See django-storages' Heroku you will need to create a bucket and add its name. See django-storages'
[Amazon S3 documentation](https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html). [Amazon S3 documentation](https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html).
## `AWS_S3_ENDPOINT_URL`
*Default:* `None`
Custom URL to use when connecting to S3, including scheme.
This allows to use a S3-compatible storage service of another provider than AWS.
## `CSRF_TRUSTED_ORIGINS` ## `CSRF_TRUSTED_ORIGINS`
*Default:* `None` *Default:* `None`