标签:call uwsgi pes post root turn mod sys chdir
unable to load app 0 (mountpoint=‘‘) (callable not found or import error)
--- no python application found, check your startup logs for errors ---
猜测原因应该是某些环境变量没有加到配置中,找了一个解决办法,但是忘记博客的网址了,所以把答案记录下来。就是在etc/profile中加上一句话:export PATH=/usr/local/bin:$PATH
nginx配置
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
upstream loginay{
server 127.0.0.1:8002;
}
server {
listen 8002;
server_name 127.0.0.1; # 改为自己的域名,没域名修改为127.0.0.1:80
charset utf-8;
location / {
include uwsgi_params;
uwsgi_pass 127.0.0.1:8808; # 端口要和uwsgi里配置的一样
uwsgi_param UWSGI_SCRIPT AdminSystem.wsgi; #wsgi.py所在的目录名+.wsgi
uwsgi_param UWSGI_CHDIR /home/subject/AdminSystem/; # 项目路径
}
location /static {
alias /home/subject/AdminSystem/static;
}
}
server {
listen 80;
server_name www.pay.xinxiajiaoyu.cn;
charset utf-8;
location / {
root /home/html; # html访问路径
index index.html; # html文件名称
try_files $uri $uri/ /index.html; # 解决单页面应用刷新404问
}
location /api/uniPayApi.action { #post请求反向代理,像该域名发送请求
# return 307;
proxy_method POST;
proxy_pass https://www.joinpay.com/trade/uniPayApi.action;
proxy_redirect default;
}
location /api/fastpaySmsApi.action {
proxy_pass https://www.joinpay.com/trade/fastpaySmsApi.action;
}
location /api/fastpayPayApi.action {
proxy_pass https://www.joinpay.com/trade/fastpayPayApi.action;
}
location /accounts/loginay { #反向代理,请求accounts/loginay直接
proxy_pass http://loginay;
}
}
}
```
3.uwsgi的配置
<uwsgi>
<socket>127.0.0.1:8808</socket>
<chdir>/home/subject/AdminSystem/</chdir>
<module>AdminSystem.wsgi</module>
<processes>10</processes>
<daemonize>uwsgi.log</daemonize>
</uwsgi>
标签:call uwsgi pes post root turn mod sys chdir
原文地址:https://www.cnblogs.com/michealjy/p/12669220.html