The purpose of this project is to provide examples of how we can use (integrate) different Python Web Frameworks together using a2wsgi.
Who likes migration? But in some cases, it's necessary. a2wsgi helps us to convert our ASGI applications to WSGI or vice versa.
A Scenerio (that I have faced): You have a Flask application and you want to migrate it to FastAPI. You have two options:
- Rewrite the whole application from scratch and deploy it when it's ready.
- Use a2wsgi to convert your Flask application to WSGI using a2wsgi and then integrate (mount) it to your FastAPI application and deploy it. By the time, you can rewrite your application step by step.
Framework | Mount | Protocol | Documentation |
---|---|---|---|
Flask | ✅ | ASGI/WSGI | Application Dispatching — Flask Documentation (3.0.x) |
FastAPI | ✅ | ASGI/WSGI | Sub Applications - Mounts - FastAPI |
Django | ✅ | ASGI/WSGI | |
Starlette | ✅ | ASGI/WSGI | |
Litestar | ✅ | ASGI/WSGI | |
BlackSheep | ❌ | ASGI | |
Quart | ❌ | ASGI | |
Falcon | ❌ | ASGI/WSGI | |
Sanic | 🔳 | ASGI | |
Connexion | 🔳 | ASGI | |
Bottle | ✅ | WSGI | |
Robyn | ❌ | ||
HUG | ❌ | ||
Tornado | ❌ | ||
Pyramid | 🔳 | WSGI | |
webapp2 | 🔳 | ||
aiohttp |
More WSGI: Frameworks that run on WSGI — WSGI.org
More ASGI: Implementations — ASGI 3.0 documentation
Framework | Mount |
---|---|
GradIO | ✅ |
PyWebIO | ✅ |
Flet | ✅ |
NiceGUI | 🚧 |
Reflex | 🚧 |
Streamlit | 🔳 |
Plotly Dash | 🔳 |
Emoji key:
- ✅: Accomplished
- 🔳: Not tried yet
- ❌: Tried and failed
- 🚧: In progress
⚠️ : Not sure if possible
- Docker
- Docker Compose
- Clone the repository
- Run
docker-compose up --build
- Go to
http://localhost:8000/docs
to see the API documentation - Enjoy!
If you would like to contribute to this project, please open an issue or submit a pull request.
- hasansezertasan, It's me 👋
This project is licensed under the MIT License - see the LICENSE file for details.