from flask import Flask,request,render_template
from tornado.wsgi import WSGIContainer
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
app = Flask(name)
@app.route(’/’, methods=[‘GET’])
def index(name = None):
if request.method == ‘GET’:
name = "WEB SERVER"
return render_template(‘index.html’,name=name)
if name == ‘main’:
try:
http_server = HTTPServer(WSGIContainer(app))
http_server.listen(5000)
IOLoop.instance().start()
app.debug = True
#app.run(host=‘0.0.0.0’, port=80, debug=True)
except:
pass
运行这个文件,也不提示错误,系统直接退出了,
运行后程序直接退出了,无法启动多并发处理
改成那个注释的语句:
app.run(host=‘0.0.0.0’, port=80, debug=True)
是没有问题的