The general idea is that applications should be as flexible as possible. The goal is to have fully autonomous functionality. Now, of course, this is not always possible, and many times it even makes sense to use the functionality from another application. To do this, you simply import everything you need. For example, if your blogs application should work with your Comment model in your comments application, you simply added the following to the top of the python file you are working in:
from comments.models import Comment
You can then use Comment as if it were defined correctly in the same file.
Regarding REST, Django views are much more fluid. You can call your opinion what you like; you only need to connect it to the correct urlpattern in urls.py. Django views can return any type of content, you just prepare the answer and tell it which mimetype is used for its operation (HTML is used by default).
source share