“找不到python应用程序,请使用uWSGI部署Flask应用程序时检查错误,以检查错误”“>

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

我正在尝试部署我的flask应用程序,所以我正在测试uWSGI服务。

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并在浏览器中显示“内部服务器错误”。

我在做什么错?

我正在尝试部署我的flask应用程序,因此我正在测试uWSGI服务。从应用程序导入blah / wsgi.py如果__name__ =='__main__',则create_app l_app = create_app():create_app()blah / app / __ init__.py ...

python nginx uwsgi
1个回答
0
投票

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

© www.soinside.com 2019 - 2024. All rights reserved.