Skip to content

Instantly share code, notes, and snippets.

@mmichealjroberts
Last active July 17, 2020 08:51
Show Gist options
  • Save mmichealjroberts/88cb192f863121ad2349b6e781912193 to your computer and use it in GitHub Desktop.
Save mmichealjroberts/88cb192f863121ad2349b6e781912193 to your computer and use it in GitHub Desktop.
db = {}
db['ENGINE'] = 'django.db.backends.postgresql'
db['OPTIONS'] = {'autocommit': True}
db['NAME'] = my_model_db['database']
db['PASSWORD'] = my_model_db['password']
db['USER'] = my_model_db['user']
db['HOST'] = my_model_db['host']
logger.info("Connecting to database {db} on {host}".format(db=source_db['NAME'], host=source_db['HOST']))
connections.databases['dynamic_database_1'] = db
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment