@
XXOO 没问题, vps上RUNTIME_ENV会自动识别成local, 按照https://
github.com/deepgully/me#%E6%9C%AC%E5%9C%B0%E8%B0%83%E8%AF%95bae 更改数据库配置就行了
默认使用flask自带的服务器, 且开启debug模式
在index.py最后:
elif RUNTIME_ENV == "local":
app.run(debug=True)
你也可以使用其他WSGI服务器, 如 gevent
elif RUNTIME_ENV == "local":
from gevent.wsgi import WSGIServer
http_server = WSGIServer(('', 80), app, log=None)
http_server.serve_forever()
或者 tornado
elif RUNTIME_ENV == "local":
from tornado.wsgi import WSGIContainer
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
http_server = HTTPServer(WSGIContainer(app))
http_server.listen(80)
IOLoop.instance().start()