Skip to content

Instantly share code, notes, and snippets.

@rodrigobertin
Last active September 17, 2024 23:57
Show Gist options
  • Save rodrigobertin/81b36da88d0d1d237fda02e92ef2820b to your computer and use it in GitHub Desktop.
Save rodrigobertin/81b36da88d0d1d237fda02e92ef2820b to your computer and use it in GitHub Desktop.
Django 5.1 Storages
AWS_S3_ENDPOINT_URL = f'https://{os.environ.get("BUCKET_NAMESPACE")}.compat.objectstorage.{os.environ.get("BUCKET_REGION")}.oraclecloud.com'
STORAGES = {
"default": {
"BACKEND": "storages.backends.s3.S3Storage",
"OPTIONS": {
"access_key": os.environ.get('BUCKET_KEY'),
"secret_key": os.environ.get('BUCKET_SECRET'),
"bucket_name": os.environ.get('BUCKET_NAME'),
"region_name": os.environ.get('BUCKET_REGION'),
"endpoint_url": AWS_S3_ENDPOINT_URL,
"querystring_auth": False,
"file_overwrite": False,
},
},
"staticfiles": {
"BACKEND": "django.contrib.staticfiles.storage.StaticFilesStorage"
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment