Python Forum

Full Version: what is difference between python CGI and webapplication
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
what is difference between python CGI and webapplication
Quote:WSGI runs the Python interpreter on web server start, either as part of the web server process (embedded mode) or as a separate process (daemon mode), and loads the script into it. Each request results in a specific function in the script being called, with the request environment passed as arguments to the function.

CGI runs the script as a separate process each request and uses environment variables, stdin, and stdout to "communicate" with it.

And i believe web applications such as django are advanced wrappers around wsgi.
Django, Flask, bottle.py, Pyramid, Sanic are web frameworks running on WSGI which is running on some web server like Apache or Nginx.

You can use these frameworks to build a web application. Or you can use plain SGI. The frameworks just make it easier for you.