Search code examples
pythonwebwsgi

alternative to WSGI framework


What are the alternatives to WSGI ? Is there any python web framework which usages non WSGI? How it is different from WSGI? I could not found any example where WSGI is not used on internet.

Thanks


Solution

  • Short answer: Yes, there are interfaces such as CGI, FastCGI, and a multitude of other options.

    Long answer: WSGI is a more practical option for a python framework that requires an interface.

    WSGI is designed to be the standard protocol for serving python web frameworks such as flask. Without it, your framework cannot be safely and properly self-hosted for public use and does not have perfect scalability. They also usually require a reverse proxy such as Nginx to act as the webserver, reverse proxy, and/or to forward requests. It acts as follows:

    client <--> Nginx or web server <--> WSGI interface <--> framework

    or

    client <--> WSGI interface <--> framework

    There are multiple options to choose from for interfaces, and they can be found here, but they are all essentially the WSGI interface -- all written in python. There is also ASGI, which is the successor to WSGI.