1.14.3.1 web.wsgi.cgi - CGI Variable Access

The web.wsgi.cgi module provides one class CGI which adds the key 'web.cgi' to the environ dictionary. Middleware or applications further down the chain can access CGI variables usually accessed through the web.cgi object by using environ['web.cgi']. The class takes no arguments.

class CGI( application)
application
A WSGI application or middleware component

Entries added to environ:

environ['web.cgi']
CGI information in the format of web.cgi

For example:

import web.wsgi.cgi

def myApp(environ, start_response):
    start_response('200 OK', [('Content-type','text/plain')])
    return ['Here are the CGI variables: %s'%('\n'.join(environ['web.cgi'].keys()))]
    
application = web.wsgi.cgi.CGI(myApp)