Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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']"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