row_template tr td td td td tr def application environ start_response

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
row_template = " <tr><td>%s</td><td>%r</td></tr>"
def application(environ, start_response):
status = "200 OK"
headers = [('Content-Type', 'text/html'), ]
start_response(status, headers)
content = html_template % {
'python_version': sys.version,
'platform': sys.platform,
'abs_path': os.path.abspath('.'),
'filename': __file__,
'python_path': repr(sys.path),
'wsgi_env': '\n'.join([row_template % item for item in environ.items()]),
}
return [content]