How to setup a django project such that two independent django apps read and write to the same models

StackOverflow https://stackoverflow.com/questions/15556237

문제

I have to create a django project which has two dictinct parts. The producer provides some UI to the user and eventually writes to some models. The consumer uses this data and does some processing and shows some pretty graphs etc.

Technically, these are completely isolated apps used by completely distinct user set. I would love to make them separate django projects altogether but unfortunately they share the db structure. The database is effectively a pipe that connects the two.

How should I structure the project? From what I read, I should ideally have isolated models per app. Unfortunately that is not possible.

Any recommendations?

도움이 되었습니까?

해결책

If you define a "app" and use it inside of your "Django Project" I assume you use INSTALLED_APP's in settings.py to make it known within your environment.

If you look it from this point - its the same as if you use "django-social-auth" in two different projects/services and you share the same DB. I can't judge if its common or uncommon to use the same DB, its a design decision you have to make and you need to be happy with.

If you just like to have users and webusers seperated in your admin, please have a look at separating-staff-and-user-accounts

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top