hasansezertasan / a2wsgi-examples

The goal of this project is to provide examples about integrating different Python Web Frameworks and how they can be used together with a2wsgi.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

a2wsgi Examples

The purpose of this project is to provide examples of how we can use (integrate) different Python Web Frameworks together using a2wsgi.

Why

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:

  1. Rewrite the whole application from scratch and deploy it when it's ready.
  2. 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.

Progress

Frameworks

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

Other tools

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

How to run

Requirements

  • Docker
  • Docker Compose

Steps

  1. Clone the repository
  2. Run docker-compose up --build
  3. Go to http://localhost:8000/docs to see the API documentation
  4. Enjoy!

Contributing

If you would like to contribute to this project, please open an issue or submit a pull request.

Author

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

The goal of this project is to provide examples about integrating different Python Web Frameworks and how they can be used together with a2wsgi.

License:MIT License


Languages

Language:Python 97.3%Language:Dockerfile 2.7%