Flask依赖一个实现wsgi协议的模块:werkzeug

#_*_ encoding: utf-8 _*_   @author: ty  hery   2019/12/20

# Flask依赖一个实现wsgi协议的模块:werkzeug
from  werkzeug.wrappers import  Request,Response

@Request.application
def hello(request):
    return Response('hello world! {}'.format(request))
# 返回  hello world! <Request 'http://127.0.0.1:4000/hello' [GET]>

if __name__ == '__main__':
    from werkzeug.serving import run_simple
    run_simple('127.0.0.1',8000,hello)
上一篇:启动pyspider报错


下一篇:初识 Flask