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>'