flask+uwsgi+云服务器 部署服务端
参考:使用uwsgi部署flask
报错
“找不到Python应用程序,请检查启动日志以查找错误”
或者:
no python application found, check your startup logs for errors
debug 过程:查到Python uWSGI 安装配置 里面说,先写测试文档:
def application(env, start_response):start_response('200 OK', [('Content-Type','text/html')])return [b"Hello World"]
运行之后,没有报错,下面文中继续解释说:
uWSGI Python 加载器将会搜索的默认函数
application
在 flask 框架中,我的 app.py 文件的程序叫 app
,所以才会找不到 python application,所以解决方法:
uwsgi --plugin python --http :8099 --wsgi-file app.py --callable app
(即在后面加一个 --callable
参数即可)