I am new to Django, the way I understand the database migration structure is allotted per app. If I have several apps inside the project, how do I refer the models/data in database on another apps?
Let's say I have these apps:
I have created User, Balance, Expense, Income models on Home app. How do I access these data on Expense and Income?
Is there a better way to implement project structure as I am not quite sure that my current implementation is the right one. Is it correct to implement models that should be accessible from all apps within a certain app?
First, you need to add all your apps into INSTALLED_APPS in settings.py
And then you can import other apps' models by
from expense.models import MODEL_NAME
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments