有两个启动文件
manage.py ,使用 flask-script 插件,最后是 manage.run()
使用命令行:gunicorn manage:app -b localhost:8000 成功启动
run.py ,我不太明白这下面两句是什么意思
from werkzeug.contrib.fixers import ProxyFix
app.wsgi_app = ProxyFix(app.wsgi_app)
app.run(host='127.0.0.1',port=8000)
但是使用 gunicorn run:app -b localhost:8000 同样启动成功
使用 supervisor 配置文件内容如下
[program:niceblog]
command=/home/seven/.pyenv/versions/daily/bin/gunicorn manage:app -b localhost:8000
diretory=/home/seven/Desktop/niceblog
user=root
autostart=true
autorestart=true
tdout_logfile=/home/seven/Desktop/niceblog/logs/gunicorn_supervisor.log
由于使用的是 pyenv 所以 gunicorn 路径是那样,路径应该没错
command 不管是 manage:app,还是 run:app 都不行
manage:app,logs 提示 No module named 'manage'
run:app,logs 提示 fail find application run
希望有人可以帮忙指点一下,谢谢
/home/seven/Desktop/niceblog
这个是你app的根目录么?