dimanche 29 novembre 2020

How WSGI application talks to web server?

Python web applications mostly follow WSGI interface. A set of standard rules written to allow python application to talk to web server.

The web server and application internally uses web server protocol to communicate. This can be mod_python/cgi/fastcgi/scgi.

WSGI is Python specific programming interface or an abstraction layer written for Python web applications. So, we can use any web server that have WSGI wrapper/interface to communicate with Python web application. Internally this web server will use one of the CGI/FASTCGI/SCGI web protocol or low level gateways.

Also we have mod_wsgi that will use Apache server specifically but can talk to WSGI application. There are some others too. Like Gunicorn is a WSGI server based on pre-forking model which I think is like a FastCGI protocol.

So web server can either fork ,created a thread, embed the interpretor or follow any other protocol internally to talk to WSGI application.

Is this somewhat the idea?




Aucun commentaire:

Enregistrer un commentaire