Skip to content

Instantly share code, notes, and snippets.

@longfin
Created January 13, 2012 13:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save longfin/1606137 to your computer and use it in GitHub Desktop.
Save longfin/1606137 to your computer and use it in GitHub Desktop.
very simple wsgi application(via class)
class App(object):
def __init__(self, environ, start_response):
self.environ = environ
self.start_response = start_response
def __iter__(self):
status = '200 OK'
response_body = "Hello World!"
response_headers = [('Content-Type', 'text/plain'),
('Content-Length', str(len(response_body)))]
self.start_response(status, response_headers)
yield response_body
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment