Instantly share code, notes, and snippets.

@nottrobin /wsgi.py
Last active Sep 3, 2018

Embed
What would you like to do?
Simple WSGI application server
from wsgiref.simple_server import make_server
def application(env, start_response):
"""
A basic WSGI application
"""
http_status = '200 OK'
response_headers = [('Content-Type', 'text/html')]
response_text = "Hello World"
start_response(http_status, response_headers)
return [response_text]
if __name__ == "__main__":
make_server('', 8000, application).serve_forever()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment