python - How to swap configuration files for Production and Development? -


some time ago created script using python, script execute actions in instance based on configuration file.

this issue, created 2 configuration files.

config.py

instance= <production url> value1= value2= b ... 

testconfig.py

instance= <development url> value1= c value2= d ... 

so when want script execute tasks in development instance tests, import testconfig.py instead of config.py.

main.py

# config import * testconfig import * 

the problem comes when update script using git. if want run script in development have modify file manually, means have uncommited changes in server.

doing change takes 1 min of time feel i'm doing wrong.

do know if there's standard or right way accomplish kind of tasks?

export environment variables on machines, , chose settings based on environment variable.


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? -