Menu:

a mini fastCGI Test App.

Python
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
import cgi

import sys, os

def app(environ, start_response):
    start_response('200 OK', [('Content-Type', 'text/html')])

    yield '<h1>FastCGI Environment</h1>'

    yield '<table>'

    for key, value in sorted(environ.items()):
        yield '<tr><th>%s</th><td>%s</td></tr>' % (
            cgi.escape(key), cgi.escape(value)
        )
    yield '</table>'