I want to make a project, which uses Django as backend, PostgreSQL as database and FastAPI with Django REST Framework for REST. Don't see any problems with making a project just with Django, DRF and Postgres, but face with difficulties when speak about FastAPI and DRF at the same time. So there is no problem in connecting Postgres to Django, and there is no problem to make endpoints for DRF. But how can I connect fastapi? Where to place endpoints and how to run all this stuff together? In some examples I saw that FastAPI isntance is initiated in WSGI.py and then server runs from calling commands such like this:
uvicorn goatfish.wsgi:app
But i am not sure that it works like this when I mix more than only Django and FastAPI. I want to use FastAPI for optical character recongnition and DRF for user registration, logins etc. Are there any advices about making project with such a structure? Or maybe someone have a repository with such kind of project on github?
EDIT: Hope to see answers here, but for now I only see the solution in making classic Django + DRF app, then make FastAPI app with endpoints, run these apps on different ports and do some chain of actions: From django app we load an image to form and when we submit this form we send POST request to FastAPI endpoint, which will run OCR process and then return JSON with recognized text and then will send this JSON to the Django Callback endpoint, which will process it and save to the database. What do you think about such thing?