Differences and uses between WSGI, CGI, FastCGI, and mod_python in regards to Python?

PythonCgiFastcgiWsgiMod Python

Python Problem Overview


I'm just wondering what the differences and advantages are for the different CGI's out there. Which one would be best for python scripts, and how would I tell the script what to use?

Python Solutions


Solution 1 - Python

A part answer to your question, including scgi.

> CGI vs FCGI

Lazy and not writing it on my own. From the wikipedia: http://en.wikipedia.org/wiki/FastCGI

Instead of creating a new process for each request, FastCGI uses persistent processes to handle such requests. Multiple processes can configured, increasing stability and scalability. Each individual FastCGI process can handle many requests over its lifetime, thereby avoiding the overhead of per-request process creation and termination

Solution 2 - Python

There's also a good background reader on CGI, WSGI and other options, in the form of an official python HOWTO: http://docs.python.org/2/howto/webservers.html

Solution 3 - Python

In a project like Django, you can use a WSGI (Web Server Gateway Interface) server from the Flup module.

A WSGI server wraps a back-end process using one or more protocols:

Solution 4 - Python

  • FastCGI is a kind of CGI which is long-live, which will always be running.
  • With FastCGI, it'll take less time.
  • Because of multi-processes, FastCGI will cost more memory than CGI.

In Detail Diff between FastCGI vs CGI

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionParkerView Question on Stackoverflow
Solution 1 - PythonpyfuncView Answer on Stackoverflow
Solution 2 - PythonRichard BoardmanView Answer on Stackoverflow
Solution 3 - PythonCees TimmermanView Answer on Stackoverflow
Solution 4 - PythonnaveenKumarView Answer on Stackoverflow