鍍金池/ 問答/Python  Linux/ gunicorn 命令行啟動(dòng) flask 成功,使用 supervisor 啟動(dòng)

gunicorn 命令行啟動(dòng) flask 成功,使用 supervisor 啟動(dòng)就失敗,求解答?

有兩個(gè)啟動(dòng)文件
manage.py ,使用 flask-script 插件,最后是 manage.run()
使用命令行:gunicorn manage:app -b localhost:8000 成功啟動(dòng)

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 同樣啟動(dòng)成功

使用 supervisor 配置文件內(nèi)容如下
[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 路徑是那樣,路徑應(yīng)該沒錯(cuò)

command 不管是 manage:app,還是 run:app 都不行

manage:app,logs 提示 No module named 'manage'

run:app,logs 提示 fail find application run

希望有人可以幫忙指點(diǎn)一下,謝謝

回答
編輯回答
夢(mèng)一場(chǎng)

/home/seven/Desktop/niceblog 這個(gè)是你app的根目錄么?

2017年4月22日 11:17