I have a Django web front-end that consumes data from a REST API backend.
Even the users are made and created on the backend.
My Problem :
- How to use 3rd party apps within this system, that heavily depend on django models/ORM ?
- Is there something that can provide some bridge between the REST API resources and the ORM?
How can this problem be dealt with ?
Update
DRY principal seems to be failing in this situation.
I’m not sure I completely understand your question or requirements. The way I am reading it, you have a primary back-end which is basically a black-box, and you want to use some 3rd-party apps in your project which use the Django ORM.
I am unclear as to why there would be a need for being able to have a two-way synchronization between the two data-stores. The users of your project would be returned data from your primary back-end, and from the project’s ORM.
Since you are concerned about saving the “ORM” data in your primary back-end, maybe you would consider creating a Transaction Middleware that would fire any time ORM data gets updated, which could serialize the structure being saved and transmit it to your REST API. This REST API, I assume, is able to accept arbitrary data structures?
You’ll probably at least want to use some form of middleware, and maybe a utility module/class to help form the “bridge”.