Skip to content

Commit

Permalink
Support postgres as well as mysql.
Browse files Browse the repository at this point in the history
  • Loading branch information
ralphbean committed May 15, 2014
1 parent fbc8f8b commit 81699e3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tahrir_api/scripts/initializedb.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ def main(argv=sys.argv):

global_conf = None
if 'OPENSHIFT_APP_NAME' in os.environ:
template = '{OPENSHIFT_MYSQL_DB_URL}{OPENSHIFT_APP_NAME}'
if 'OPENSHIFT_MYSQL_DB_URL' in os.environ:
template = '{OPENSHIFT_MYSQL_DB_URL}{OPENSHIFT_APP_NAME}'
elif 'OPENSHIFT_POSTGRESQL_DB_URL' in os.environ:
template = '{OPENSHIFT_POSTGRESQL_DB_URL}{OPENSHIFT_APP_NAME}'

global_conf = {
'sqlalchemy.url': template.format(**os.environ)
}
Expand Down

0 comments on commit 81699e3

Please sign in to comment.