How can I connect to a different database when in a Django shell?
Something like:
python manage.py shell --database=slave
I tried googling all around, but couldn't find anything useful on this.
This is what my settings looks like:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'db1',
'USER': 'user',
'PASSWORD': 'password',
'HOST': '10.10.10.10',
'PORT': '',
'CONN_MAX_AGE': 1000,
},
'slave':{
'ENGINE': 'django.db.backends.mysql',
'NAME': 'db2',
'USER': 'user',
'PASSWORD': 'password',
'HOST': '10.10.10.10',
'PORT': '',
'CONN_MAX_AGE': 1000,
},
}