0

How to create or add multiple databases in django. Where always my models are created in default database .how to change it

8
  • Please post what you have tried. Commented Nov 24, 2018 at 16:43
  • I dint tried any. I'm blank in switching dbs Commented Nov 24, 2018 at 17:23
  • Have you tried Google searching? Commented Nov 24, 2018 at 17:27
  • Tried googling....but dint get proper answer Commented Nov 24, 2018 at 17:32
  • Here is a similar question I found. Maybe this can help a little... Commented Nov 24, 2018 at 17:33

1 Answer 1

0

Django documentation has good reference on this

https://docs.djangoproject.com/en/2.1/topics/db/multi-db/

Once you define the databases a new database other than 'default', you can use

$ ./manage.py migrate --database=new_database_name

for performing the migration or table creation

Sign up to request clarification or add additional context in comments.

1 Comment

Yeah I saw those things....in my project,user wants to create a new database every time. Where in cannot cannot add those databases every time in settings...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.