perseids-project / digital_milliet

The Digital Milliet
https://digmill.perseids.org
0 stars 4 forks source link

Configure application with environment #85

Closed zfletch closed 6 years ago

zfletch commented 6 years ago

Using the Flask-Env library, allow overwriting configuration files with environment variables. This is done by passing ENV as an argument to run.py and putting DIGMILL_ before a particular configuration option.

For example: env DIGMILL_MONGO_HOST=mongo python run.py config.cfg ENV will use the configuration specified in config.cfg but overwrite the MONGO_HOST option.

I think this is the ideal solution. It provides a lot of flexibility without making major changes, since:

coveralls commented 6 years ago

Coverage Status

Coverage increased (+0.03%) to 86.236% when pulling 6939ed532571dfd16d2a3a38e9aa2537c49ac26f on configure-with-env into 7786138f2c5d59dc9293908c9ab5ffb21f15cf24 on master.