您好,我正在尝试部署我的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 ---
在浏览器中显示“内部服务器错误”。我完全迷路了,需要帮助,谢谢。
我认为正确的方法是定义:
module = wsgi
callable = l_app