应用程序部署在heroku上,但未打开。已使用python

应用程序部署在heroku上,但未打开。已使用python,python,flask,heroku,Python,Flask,Heroku,这就是我得到的错误 这是我在部署时第三次遇到相同的错误。 我还检查了日志。日志文件内容为: 请帮忙 2021-03-23T19:58:37.705318+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/%20deployed%20to%20Heroku" host=co2-emission-pre-diction.heroku

这就是我得到的错误

这是我在部署时第三次遇到相同的错误。 我还检查了日志。日志文件内容为:

请帮忙

2021-03-23T19:58:37.705318+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/%20deployed%20to%20Heroku" host=co2-emission-pre-diction.herokuapp.com request_id=c3e2c6e3-0762-46f5-b2fd-99149f594594 fwd="157.45.119.41" dyno= connect= service= status=503 bytes= protocol=https
2021-03-23T19:58:38.517056+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=co2-emission-pre-diction.herokuapp.com request_id=dea037a8-d4ee-429f-a31a-595d79c430cb fwd="157.45.119.41" dyno= connect= service= status=503 bytes= protocol=https
2021-03-23T19:58:45.302966+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=co2-emission-pre-diction.herokuapp.com request_id=f4584f03-44f1-4117-aabb-6d7e6d888a2e fwd="157.45.119.41" dyno= connect= service= status=503 bytes= protocol=https
2021-03-23T19:58:46.898144+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=co2-emission-pre-diction.herokuapp.com request_id=fc38ae35-5afb-4a41-a8fb-a96574232c7d fwd="157.45.119.41" dyno= connect= service= status=503 bytes= protocol=https
2021-03-23T19:59:18.687973+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=co2-emission-pre-diction.herokuapp.com request_id=9f7e3d6f-7356-4994-b8d4-0f9b1656b679 fwd="157.45.119.41" dyno= connect= service= status=503 bytes= protocol=https
2021-03-23T19:59:19.522940+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=co2-emission-pre-diction.herokuapp.com request_id=926260ee-1f96-4ed6-90f0-e62bc10e7f13 fwd="157.45.119.41" dyno= connect= service= status=503 bytes= protocol=https
2021-03-23T19:59:55.796315+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=co2-emission-pre-diction.herokuapp.com request_id=9e4a1ad9-c826-430a-837d-6c3bb1623629 fwd="157.45.119.41" dyno= connect= service= status=503 bytes= protocol=https
2021-03-23T19:59:56.428470+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=co2-emission-pre-diction.herokuapp.com request_id=36e2296a-8364-42a3-b647-65136ea59972 fwd="157.45.119.41" dyno= connect= service= status=503 bytes= protocol=https
2021-03-23T20:01:35.260787+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=co2-emission-pre-diction.herokuapp.com request_id=e0070481-0492-4b10-975b-27ddbb086646 fwd="157.45.119.41" dyno= connect= service= status=503 bytes= protocol=https
2021-03-23T20:01:36.411104+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=co2-emission-pre-diction.herokuapp.com request_id=0a59ff26-3a8d-45d4-a3b6-030f8126fc8b fwd="157.45.119.41" dyno= connect= service= status=503 bytes= protocol=https
2021-03-23T20:04:08.260298+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=co2-emission-pre-diction.herokuapp.com request_id=e9e66103-fd75-4f88-9a8b-728379b146a4 fwd="157.45.119.41" dyno= connect= service= status=503 bytes= protocol=https
2021-03-23T20:04:09.542606+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=co2-emission-pre-diction.herokuapp.com request_id=88e2ee70-4247-4afa-9d9f-ebce57af9533 fwd="157.45.119.41" dyno= connect= service= status=503 bytes= protocol=https

确保顶级目录中有
Procfile

Heroku使用
Postgres
数据库,为此需要安装以下软件包:

  • 古尼科恩
  • psycopg2
您可以通过运行以下命令来完成此操作:

(venv)$pip3安装psycopg2 gunicorn
请记住更新您的
requirements.txt
文件以包含这两个包,因为Heroku将使用文件中的依赖项构建您的应用程序

更新
Procfile
,如下所示:

web:flaskdb升级;古尼康:应用程序
#如果不需要,可以删除flask db upgrade
#条目文件在FLASK_APP变量中设置
设置您的
FLASK\u应用程序
变量

(venv)$heroku配置:设置烧瓶\u APP=APP.py
提交您的更改和远程Heroku存储库,并推送到Heroku

(venv)$git commit-m'为Heroku部署添加更改'
(venv)$heroku git:remote-a
(venv)$git push heroku master
#输出
枚举对象:1170,完成。
计数对象:100%(1170/1170),完成。
增量压缩最多使用4个线程
压缩对象:100%(391/391),完成。
写入对象:100%(1170/1170),691.88 KiB | 43.24 MiB/s,完成。
总计1170(增量760),重复使用1148(增量750)
远程:正在压缩源文件。。。完成。
远程:建筑源:
远程:
远程:-->检测到Python应用程序
远程:-->安装python-3.6.12
远程:-->安装pip 20.1.1、设置工具47.1.1和控制盘0.34.2
远程:-->安装SQLite3
远程:-->带pip的安装要求
# ...
远程:-->发现进程类型
远程:Procfile声明类型->web
远程:
远程:-->正在压缩。。。
遥控器:完成:59.3米
远程:-->正在启动。。。
远程:发布v18
远程:https://your-app-name.herokuapp.com/ 部署到Heroku
远程:
远程:正在验证部署。。。完成。
到https://git.heroku.com/your-app-name.git
*[新分支]主控->主控

重新部署github repo并查看实时构建日志。它应该能让你更好地了解到底出了什么问题。非常感谢!!它工作得很好…-)