flask blueprint结构怎么部署在uwsgi下
下面的配置哪里有问题?这种用flask蓝图结构编写的程序怎么配置?一直启动不起来
test.py
from flask import Flask, Blueprint
main = Blueprint('main', __name__)
def create_app():
application = Flask(__name__)
application.register_blueprint(main)
return application
@main.route('/')
def index():
return "<span style='color:red'>I am app 1</span>"
start.ty
from test import create_app
if __name__ == '__main__':
application = create_app()
application.run()
uwsgi
[uwsgi]
socket = 0.0.0.0:8001
chdir = /home/www
wsgi-file = start.py
callable = application
processes = 1
threads = 1
stats = 127.0.0.1:9191
daemonize = /home/log/uwsgi.log
harakiri = 30
error
*** no app loaded. going in full dynamic mode ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 9133)
spawned uWSGI worker 1 (pid: 9136, cores: 1)
*** Stats server enabled on 127.0.0.1:9191 fd: 9 ***
ImportError: No module named application
unable to load app 0 (mountpoint='') (callable not found or import error)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论