我希望使用一个免费的dyno将一个flask应用程序部署到Heroku,它似乎成功地构建了:
remote: Git submodules detected, installing:
remote:
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: -----> Installing requirements with pip
remote:
remote: -----> Discovering process types
remote: Procfile declares types -> web
remote:
remote: -----> Compressing...
remote: Done: 83.2M
remote: -----> Launching...
remote: Released v94
remote: https://MYAPP.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
然后在访问URL后检查Heroku日志,抛出以下错误:
^{pr2}$在各种帮助站点中遇到过这种情况的所有其他人在绑定到Heroku$PORT
时解决了他们的问题,与我的方法相同:
#!venv/bin/python
import os
from app import app
port = int(os.environ.get('PORT', 33507))
app.run(host='0.0.0.0', port=port, debug=False)
还有我的Procfile
:
web: python run.py runserver
可能是我在运行一个虚拟环境吗?也许我83.2米的应用程序太大了?我有点困在这里了。提前感谢您的帮助!在
尝试更改:
Procfile内容应为:
端口号从33507到8080
尝试如下更改Procfile内容:
网址:gunicorn运行:app-b“0.0.0.0:$PORT”-w 3
其中run是主应用程序文件的名称,表示跑.py在
相关问题 更多 >
编程相关推荐