Multiple Database Setup

9 views
Skip to first unread message

Rajat Chopra

unread,
Oct 30, 2019, 9:37:42 AM10/30/19
to Django users
I wish to create a project with 2 apps.  Each app will have its own database - one for payments and another for statements. 

I have created a set of models within the models.py for the payments app and another set of models inside within the models.py for the statements app.

When I run the command "python manage.py migrate --database=statements" how will Django know to look at the models.py file inside of the statements app and create those tables in the statements database ?   

In other words where do I put the code that connects the models inside of an app (statements/models.py) to the database that those models should be created and stored in?
What would be an example of what this code will look like?

DANIEL URBANO DE LA RUA

unread,
Oct 30, 2019, 9:45:34 AM10/30/19
to django...@googlegroups.com

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/06bf4cc7-7261-4ac8-95fb-d523528c77e2%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages