Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
记录一下这个问题,
Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
其实就是flask未使用 WSGI 启动,所以使用wsgi启动就行了,我找到两种方式,但不知道怎么比较好坏,但以我的理解,底层都是wsgi,只是封装库不同而已。。。
希望大神指点一下
方法一:
from gevent import pywsgi
if __name__ == '__main__':
server = pywsgi.WSGIServer(('0.0.0.0', 5000), app)
server.serve_forever()
方法二:
from wsgiref.simple_server import make_server
if __name__ == '__main__':
server = make_server('', 64570, app)
server.serve_forever()