Files
deb-python-falcon/tests/dump_wsgi.py
2013-02-04 12:27:59 -05:00

27 lines
559 B
Python

import pdb
from wsgiref.simple_server import make_server
def application(environ, start_response):
wsgi_errors = environ['wsgi.errors']
pdb.set_trace()
start_response("200 OK", [
('Content-Type', 'text/plain')])
body = '\n{\n'
for key, value in environ.items():
#if isinstance(value, str):
body += ' "{0}": "{1}",\n'.format(key, value)
body += '}\n\n'
return [body]
app = application
if __name__ == '__main__':
server = make_server('localhost', 8000, application)
server.serve_forever()