xref: /unit/pkg/deb/debian.module/unit.example-python-app (revision 373:b09757e4984e)
1import os
2import datetime
3import sys
4
5def application(environ, start_response):
6    output = datetime.datetime.now().strftime("%Y-%m-%d %I:%M:%S %p")
7    output += "\n\nPython: "
8    output += sys.version
9    output += "\n\nENV Variables:\n\n"
10    for param in os.environ.keys():
11         output += param
12         output += "\t"
13         output += os.environ[param]
14         output += "\n"
15    start_response('200 OK', [('Content-type', 'text/plain')])
16    return [s.encode('utf8') for s in output]
17