Wednesday, October 30, 2019

Re: Multiple Database Setup


On Wed, 30 Oct 2019, 14:39 Rajat Chopra, <choprar@gmail.com> wrote:
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?

--
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+unsubscribe@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.

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAO_yRT0aZjK%3D0AHU0U2wp1U16%3D1fH5MXx%3D6FpgxX0sVfNDnxeg%40mail.gmail.com.

No comments:

Post a Comment