We use django-storages for configuring S3 and their docs show that these settings can be configured with client_config. [0] This setting requires a Config python object so you need to set it in a settings.py, e.g:
from botocore.config import Config
MEDIA_ROOT = ""
STORAGES = {
"default": {
"BACKEND": "storages.backends.s3.S3Storage",
"OPTIONS": {
"bucket_name": "my-pulp-bucket",
"region_name": "eu-central-1",
"client_config": Config(
connect_timeout=5, # seconds to wait for a connection
read_timeout=60, # seconds to wait for a response
retries={
"max_attempts": 10,
"mode": "standard", # or "adaptive" for backoff
},
),
},
},
"staticfiles": {
"BACKEND": "django.contrib.staticfiles.storage.StaticFilesStorage",
},
}
Note if you use addressing_style, signature_version or proxies settings then you need to move them into the client_config because it overrides them when specified. [1]
from botocore.config import Config
Config(
connect_timeout=5,
read_timeout=60,
retries={"max_attempts": 10, "mode": "standard"},
s3={"addressing_style": "path"},
signature_version="s3v4",
)
[0] Amazon S3 - django-storages 1.14.6 documentation
[1] Config Reference - botocore 1.43.8 documentation