Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
swh-deposit
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Platform
Development
Debian Packaging
swh-deposit
Commits
6e3df51b
Verified
Commit
6e3df51b
authored
1 year ago
by
Antoine R. Dumont
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
swh/deposit/settings/production.py
+23
-0
23 additions, 0 deletions
swh/deposit/settings/production.py
with
23 additions
and
0 deletions
swh/deposit/settings/production.py
+
23
−
0
View file @
6e3df51b
...
...
@@ -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
"
],
},
},
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment