为了账号安全,请及时绑定邮箱和手机立即绑定

Python2.7 flask uwsgi nginx配置找不到unable to load app 0

Python2.7 flask uwsgi nginx配置找不到unable to load app 0

收到一只叮咚 2019-05-21 11:35:27
我有一个腾讯云的服务器,使用flask,uwsgi,nginx来搭建一个服务器。按照网上的方法是这样写的。我的nginx配置是我修改的是这个文件/etc/nginx/sites-enabled/defaultserver{listen80;server_name111.230.140.182;charsetutf-8;client_max_body_size75M;location/{includeuwsgi_params;uwsgi_pass127.0.0.1:8080;uwsgi_paramUWSGI_PYTHON/usr/bin/python;uwsgi_paramUWSGI_CHDIR/home/ubuntu/project/test;uwsgi_paramUWSGI_SCRIPTtest:app;}}然后我的uwsgi.ini配置是这么写的:[uwsgi]socket=127.0.0.1:8080plugins=pythonchidir=/home/ubuntu/project/testwsgi-file=/home/ubuntu/project/test/test.pycallable=app#程序变量名protocol=httpmodule=testprocesses=4threads=2然后我的test.py是这么写的:fromflaskimportFlaskapp=Flask(__name__)@app.route('/')defindex():return'helloworld!'if__name__=='__main__':app.run(debug=True)我先是运行nginx,然后在运行uwsgi,但是会报这个错误:mapped332288bytes(324KB)for8coresOperationalMODE:preforking+threadedunabletoloadapp0(mountpoint='')(callablenotfoundorimporterror)unabletofind"application"callableinfile/home/ubuntu/project/test/test.pyunabletoloadapp0(mountpoint='')(callablenotfoundorimporterror)我也查了不少文章都没有解决我这个问题。特来求教!谢谢大家!!
查看完整描述

2 回答

  • 2 回答
  • 0 关注
  • 675 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信