Created
December 4, 2013 04:09
-
-
Save siongui/7782204 to your computer and use it in GitHub Desktop.
WSGI 简单服务器请求 From:
http://my.oschina.net/u/260264/blog/181255
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- encodeing:utf-8 -*- | |
from wsgiref.simple_server import make_server | |
def simple_app(environ, start_response): | |
status = '200 OK' | |
response_headers = [('Content-type', 'text/plain')] | |
start_response(status, response_headers) | |
return [u"This is hello wsgi app".encode('utf8')] | |
httpd = make_server('', 8000, simple_app) | |
print "Serving on port 8000..." | |
httpd.serve_forever() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment