Last active
January 15, 2016 13:37
-
-
Save foxx/632dae63b566acb76a2e to your computer and use it in GitHub Desktop.
blog
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for k in ['host', 'port', 'database', 'user', 'password']: | |
if k in dbconfig: | |
if type(dbconfig[k]) in (str, unicode): | |
match = pat.match(dbconfig[k]) | |
if match and match.groups(): | |
envvar = match.groups()[0] | |
if envvar in os.environ: | |
dbconfig[k] = os.environ[envvar] | |
if k != 'password': |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment