i have 2 projects of django and in that there are 2 apps. So now in that there is a common model with same configuration in both projects.
In project 2 in that model there are few saved values over there atleast 6-7, now i made that same model in my project 1 so i want all the saved values to show over there in my project 1 and if i create any new field values then in my both project that thing should be shown parallely
like i add any new value from project 1 in that then that values hown over both the project and vice-versa
Are these two projects using two different databases?
- Are these two databases on the same or different database servers?
- Do both projects update all the data? Or does one project update and the other only show the data?
If they are both updating the data on two different database servers, keeping two database synchronized is a difficult process. (It can be done, but it’s not easy, and filled with all sorts of edge-cases and potential problems.)
The safest and most reliable way to do this is to ensure that there’s a database in common for the two projects with the shared data, using Django’s multiple database facility to have Django pull this common data from the right sources.
1 Like
the database of both the project is same even the localhost also same .
In my admin panel of project 2 i have filled some values of model and saved over there but as i have same model and database so in admin panel of project1 it should shows me the all saved values of the model of project 2 and after that if i update or add any new value or delete any value from any one model then in other same model that thing should be affected
Are both projects running on the same computer?
I’m sorry, I’m not understanding the situation here from this description. It’s going to be a lot easier if you use specific names of models for an example.
Also, please post the DATABASES setting from both projects. (Remove the password field)
img1

img2

I had putted the image of both the project admin panel so in img2 there are many saved values but as i am using the same model and same database is there for both the img2 all saved values should be in img1 and also if i add any value in either of any model then it should be seen in both the model admin panel.
If you’re asking that question to me, I’m waiting for the answers to all the questions in my last post.