找不到python应用程序,请检查启动日志中是否有错误

问题描述 投票:0回答:1

您好,我正在尝试部署我的flask应用程序,所以我正在测试uWSGI Serving。

blah / wsgi.py

from app import create_app

l_app = create_app()


if __name__ == '__main__':
    create_app()

blah / app / __ init __。py

from flask import Flask, Blueprint
from .config import Config as config_obj
from .views import app


def create_app():
    l_app = Flask(__name__)
    l_app.register_blueprint(app)
    return l_app
[uwsgi]
module = wsgi:l_app
master = true
processes = 1
socket = /tmp/lapp.sock
chmod-socket = 666
vacuum = true
die-on-term = true                      
    location ~ ^/blah(.*)$ {
        include uwsgi_params;
         uwsgi_pass unix:///tmp/lapp.sock;
         uwsgi_param SCRIPT_NAME /app;
         uwsgi_param PATH_INFO /$1;
}


我使用的命令是uwsgi --ini myapp.ini

但是我收到一条错误消息,指出--- no python application found, check your startup logs for errors ---在浏览器中显示“内部服务器错误”。我完全迷路了,需要帮助,谢谢。

python nginx uwsgi
1个回答
0
投票

我认为正确的方法是定义:

module = wsgi
callable = l_app
© www.soinside.com 2019 - 2024. All rights reserved.