Flask Deploy to Heroku Error 2019-04-16T09:17:52.610857 + 00:00 heroku [router]:at:错误代码:H10 desc:App崩溃

问题描述 投票:-2回答:1

我正在尝试在Heroku上部署Flask应用程序并且它一直在崩溃

2019-04-16T09:17:39.523071 + 00:00 heroku [web.1]:状态从崩溃变为开始2019-04-16T09:17:43.455032 + 00:00 heroku [web.1]:用命令启动进程gunicorn run:app 2019-04-16T09:17:45.169493 + 00:00 heroku [web.1]:状态从开始变为崩溃2019-04-16T09:17:45.145760 + 00:00 heroku [web.1]:进程退出状态1

这是我的procfile

web: gunicorn run:app

这是我的run.py

from my_project import create_app
app = create_app()

这是我的my_project / init.py

def create_app(config_class=Config):
    app = Flask(__name__)

    return app

有任何修复错误的建议吗?

python heroku flask
1个回答
0
投票

将此行添加到您的运行文件中。

app.run(host='0.0.0.0', port=int(os.environ.get("PORT", 5000)))

如果你想了解更多read here

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