Implementing microservice applications involving FastAPI, Django, and Tornado
Flask 3.x provides a DispatcherMiddleware class from Werkzeug that combines isolated and valid WSGI-based applications to form a complete and larger system. These combined applications can be all Flask or different WSGI-based applications such as Django, each with a unique URL prefix. Figure 12.2 shows the directory structure of our combined projects:
Figure 12.2 – Django, FastAPI, Flask, and Tornado in one project structure
All views, repositories, services, models, and configuration files of the main Flask application are in the modules folder. On the other hand, all the application files of the FastAPI app are in the modules_fastapi folder, all components of the Django app are in the modules_django folder, all Tornado API handlers are in modules_tornado, and all GraphQL components are in the modules_sub_flask directory.
When it comes to their respective module scripts...