python - How to switch different config file running flask with uwsgi -


i deploying flask app uwsgi multiple servers. different server should run same app read different config file. there 2 config file used in app. 1 'config.py' read flask:

app.config.from_object('config') 

another 'uwsgi_config.ini' used when starting uwsgi:

uwsgi uwsgi_config.ini 

since have several server, must write several config files like: config.dev.py config.test.py config.prod.py uwsgi_config.dev.py uwsgi_config.dev.py uwsgi_config.prod.py

so question how can switch different tiers when starting uwsgi without hacking source code every time ?

i think key thing should run uwsgi this:

uwsgi uwsgi_config.dev.ini 

and flask can read 'dev' tier uwsgi_config.dev.ini. there simple way ?


Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -