Skip to content
Snippets Groups Projects
Verified Commit 6e3df51b authored by Antoine R. Dumont's avatar Antoine R. Dumont
Browse files

settings.production: Allow the use of azure backend if defined

Refs. swh/infra/sysadm-environment#5129
parent 55af9acd
No related branches found
No related tags found
No related merge requests found
......@@ -112,3 +112,26 @@ if authentication == "keycloak":
}
}
)
# Optional azure backend to use
cfg_azure = conf.get("azure", {})
if cfg_azure:
# Those 3 keys are mandatory
for key in ("container_name", "connection_string"):
if not cfg_azure.get(key):
raise ValueError(
f"Production: invalid configuration; missing {key} config entry."
)
STORAGES = {
"staticfiles": {
"BACKEND": "django.contrib.staticfiles.storage.StaticFilesStorage"
},
"default": {
"BACKEND": "storages.backends.azure_storage.AzureStorage",
"OPTIONS": {
"azure_container": cfg_azure["container_name"],
"connection_string": cfg_azure["connection_string"],
},
},
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment