wsgi.py 609 B

12345678910111213141516171819
  1. """This is a simple example of running a wsgi application with eventlet.
  2. For a more fully-featured server which supports multiple processes,
  3. multiple threads, and graceful code reloading, see:
  4. http://pypi.python.org/pypi/Spawning/
  5. """
  6. import eventlet
  7. from eventlet import wsgi
  8. def hello_world(env, start_response):
  9. if env['PATH_INFO'] != '/':
  10. start_response('404 Not Found', [('Content-Type', 'text/plain')])
  11. return ['Not Found\r\n']
  12. start_response('200 OK', [('Content-Type', 'text/plain')])
  13. return ['Hello, World!\r\n']
  14. wsgi.server(eventlet.listen(('', 8090)), hello_world)