Skip to content

Commit

Permalink
🔧(database) allow configuring database with environment variables
Browse files Browse the repository at this point in the history
The "DATABASES" setting expects a dictionary and we would like to
be able to set it via environment variables but they only allow
strings. With the new "formatter" functionality, we can solve this
by passing a json string and parsing it when reading the setting
from the environment variable.
  • Loading branch information
sampaccoud committed Sep 10, 2018
1 parent a114a42 commit 1dcb2bf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions config/cms/docker_run_production.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
This is the settings to run the Open edX CMS with Docker the FUN way.
"""

import json
import os
import platform

Expand Down Expand Up @@ -379,6 +380,7 @@
"PASSWORD": "password",
}
},
formatter=json.loads,
)

# Configure the MODULESTORE
Expand Down
1 change: 1 addition & 0 deletions config/lms/docker_run_production.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,7 @@
"PASSWORD": "password",
}
},
formatter=json.loads,
)

XQUEUE_INTERFACE = config(
Expand Down

0 comments on commit 1dcb2bf

Please sign in to comment.