Created
November 27, 2015 16:26
-
-
Save ryandotclair/ede353378eeb5f6f450b to your computer and use it in GitHub Desktop.
db info
This file contains 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
# Get DB IP info | |
if os.environ.get('DB_PORT_5432_TCP_ADDR') != None: | |
db_host = os.environ['DB_PORT_5432_TCP_ADDR'] | |
else: | |
db_host = os.getenv('SRDBHOST', "localhost") | |
# Get DB Port info | |
if os.environ.get('DB_PORT_5432_TCP_PORT') != None: | |
db_port = os.environ['DB_PORT_5432_TCP_PORT'] | |
else: | |
db_port = os.getenv('SRDBPORT', "5432") | |
# Get DB PW info | |
if os.environ.get('POSTGRES_PASSWORD') != None: | |
db_pass = os.environ['POSTGRES_PASSWORD'] | |
else: | |
db_pass = os.getenv('SRDBPASS', "mysupersecretpassword") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment