Re: define database modelwise in django

2017-08-02 Thread SHAILESH NEGI
You can create it from dbshell using different database credentials. On 8/2/17, kartik danidhariya wrote: > > > I just tried to find a solution for define database model wise in Django. > like in my settings.py there are three databases > > settings.py > > DATABASES = { > 'default': { >

Re: define database modelwise in django

2017-08-02 Thread threesixright
Have a look here: https://docs.djangoproject.com/en/1.11/topics/db/multi-db/ Basically: >>> # This will run on the 'default' database. >>> Author.objects.all() >>> # So will this. >>> Author.objects.using('default').all() >>> # This

define database modelwise in django

2017-08-02 Thread kartik danidhariya
I just tried to find a solution for define database model wise in Django. like in my settings.py there are three databases settings.py DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), }, 'db_one': {