Skip to content

Instantly share code, notes, and snippets.

@nottrobin
Last active September 3, 2018 02:59
Show Gist options
  • Save nottrobin/8c12c9921aeb885dbe07 to your computer and use it in GitHub Desktop.
Save nottrobin/8c12c9921aeb885dbe07 to your computer and use it in GitHub Desktop.
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