I have a system consisted of a few micro services that use each other. One of them is a Django server (let's name it A) and another is a python module that doesn't use Django at all (let's name it B).
My project structure looks something like this:
-root
- commons
- A
- B
Where commons is used both in A and B and in deployment copied to each. B uses A via HTTP calls.
I would like in B to use the model objects of A instead of using them as dicts. What is the best practice for this?
I attempted to move the models.py file from A to commons and import it from there in both. I don't know if it will work for B yet, as it fails the tests of A with:
RuntimeError: Model class commons.models.A.SomeModel doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.
I am using Django 1.10.3 and Python 3.5
EDIT: I am using DRF and my thoughts were once I get the response JSON via http use a serializer (move it to commons as well) to serialize the model objects and then I can use as objects with members and methods.
Thanks ahead,