-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Look into alternative approach for configuration #98
Comments
Some rough thoughts on this. Using environment variables for configuration, as currently, has some disadvantages:
|
A possible vision of how a better system could look. Configuration filesSomewhere is the codebase is a directory of configuration files, one per deployed environment (prod, stage, test, etc.), plus one for local development and one for the test suite (last two might be the same). Each file is Python (or yaml or json), containing configuration in a simple format: db_host = "localhost"
db_schema = "api"
bucket_name = "api-bucket-test"
logging_level_override = {"api": "INFO", "sqlalchemy": "WARNING"}
... These files get included in the container with the code. When the system starts, it loads the correct config depending on some detection of which environment it's running in. That could be an env var, or a required command line flag, with the name or path of the config file. Questions:
Usage in the codeTwo possible approaches:
|
quick discussion with @jamesbursa on whether we should consider moving non-secret configs to config files
also look at https://flask.palletsprojects.com/en/2.2.x/config/
The text was updated successfully, but these errors were encountered: