Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 examples
Octocat-spinner-32 tests
Octocat-spinner-32 wsgi2cgi
Octocat-spinner-32 .gitignore
Octocat-spinner-32 CHANGES
Octocat-spinner-32 COPYING
Octocat-spinner-32 MANIFEST.in
Octocat-spinner-32 README.md
Octocat-spinner-32 setup.py
README.md

wsgi2cgi

Run CGI apps under Python WSGI protocol (PEP 333).

This is a simple WSGI application that executes an external process and translates the WSGI protocol to the Common Gateway Interface (CGI).

Example:

from wsgiref.simple_server import make_server
import wsgi2cgi

def app(environ, start_response):
   wapp = wsgi2cgi.CGI('/path/to/executable.cgi')
   return wapp.application(environ, start_response)

httpd = make_server('127.0.0.1', 8000, app)
print "Serving on 127.0.0.1:8000..."
httpd.serve_forever()

The CGI class supports two arguments:

  • command: absolute path to the CGI application executable.
  • extra_env: additional environment variables.

The WSGI application can be used with any server supporting WSGI.

More information:

Install

The module can be installed using setup.py:

python setup.py install

Alternativelly it can be installed with pip:

pip install wsgi2cgi

License

This package is open source under the MIT license terms. Check COPYING file for further details.

Author

Something went wrong with that request. Please try again.