from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!"
pip install tornado
from tornado.httpserver import HTTPServer
from tornado.wsgi import WSGIContainer
from flask_app import app
from tornado.ioloop import IOLoop
s = HTTPServer(WSGIContainer(app))
s.listen(8080) # 监听 8080 端口
IOLoop.current().start()
python server.py
http {
server {
listen 80;
server_name www.test.com;
charset utf-8;
location / {
root html;
index index.html index.htm;
proxy_pass http://ip:8080;
}
}
标签:index,8080,flask,app,windows,tornado,服务器,import
From: https://www.cnblogs.com/xlsh/p/17163648.html