WSGI应用程序示例

import time
# WSGI允许开发者自由搭配web框架和web服务器
def app(environ,start_response):
    status = '200 OK'
    response_headers = [('Content-Type','text/html')]
    start_response(status,response_headers)
    return str(environ)+" Hello WSGI ---%s----"%(time.ctime())

print(time.ctime()) #Tue Jan 14 21:55:35 2020

2020-05-07

posted @ 2020-05-07 19:34  CodeYaSuo  阅读(267)  评论(0编辑  收藏  举报