クリーンWSGIアプリのためのPythonライブラリでPY:
from wsgiref.simple_server import make_server
def application(environ, start_response):
# Sorting and stringifying the environment key, value pairs
response_body = ['%s: %s' % (key, value)
for key, value in sorted(environ.items())]
response_body = '\n'.join(response_body)
status = '200 OK'
response_headers = [('Content-Type', 'text/plain'),
('Content-Length', str(len(response_body)))]
start_response(status, response_headers)
return [response_body]
# Instantiate the WSGI server.
# It will receive the request, pass it to the application
# and send the application's response to the client
httpd = make_server(
'localhost', # The host name.
8051, # A port number where to wait for the request.
application # Our application object name, in this case a function.
)
# Wait for a single request, serve it and quit.
httpd.handle_request()
は、その後、あなたはnginxの使用することができます:http://wiki.nginx.org/NgxWSGIModule
これはあるが、ほとんどの、安定した、安全で裸 - 骨の設定。
より多くの例:https://bitbucket.org/lifeeth/mod_wsgi/src/6975f0ec7eeb/examples/。
これは(尋ねられたように)学ぶ最も良い方法です。私はすでにこの道を歩いている。
最小要件はPythonとWebフレームワークです。 ;-) – Keith
"... Webページを実行..."?ハァッ?それはどういう意味ですか? –
@Chris、おそらくそれはIEでそれらを見ることを意味します) –