【问题标题】:deploing django app to heroku: application error将 django 应用程序部署到 heroku:应用程序错误
【发布时间】:2019-07-30 13:10:33
【问题描述】:

我正在尝试将我的项目部署到 heroku。我是 django 和 heroku 的新手,所以我很感激任何帮助。一切顺利,直到打开heroku应用程序出现应用程序错误

过程文件

web: gunicorn count_project.wsgi

requirements.txt

dj-database-url==0.5.0
Django==2.2
django-heroku==0.3.1
gunicorn==19.9.0
psycopg2==2.8.3
pytz==2019.1
sqlparse==0.3.0
whitenoise==4.1.3

运行时.txt

python-3.7.3

运行heroku日志后的消息--tail

2019-07-30T13:03:42.277475+00:00 heroku[web.1]: Starting process with command `gunicorn count_project.wsgi`
2019-07-30T13:03:46.087651+00:00 heroku[web.1]: State changed from starting to crashed
2019-07-30T13:03:46.065132+00:00 heroku[web.1]: Process exited with status 127
2019-07-30T13:03:46.018957+00:00 app[web.1]: bash: gunicorn: command not found
2019-07-30T13:03:46.000000+00:00 app[api]: Build succeeded
2019-07-30T13:03:58.852793+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=countthewords.herokuapp.com request_id=77fd8632-f1ec-4f12-9271-3f9c42dc19d3 fwd="95.102.233.42" dyno= connect= service= status=503 bytes= protocol=https
2019-07-30T13:04:00.698445+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=countthewords.herokuapp.com request_id=f05da2fd-0222-4ef6-a005-b4dcbd0993ce fwd="95.102.233.42" dyno= connect= service= status=503 bytes= protocol=https

【问题讨论】:

  • 你也有Pipfile和/或Pipfile.lock吗?

标签: python django heroku


【解决方案1】:

您是否在 Heroku 中添加了构建包(在设置下)?

你应该添加 heroku/python。

【讨论】:

  • 在哪些设置下?抱歉这么愚蠢的问题,这是我第一次与 heroku 合作
  • 在 Heroku 中,转到您的项目,然后转到设置选项卡。应该类似于dashboard.heroku.com/apps/YOUR_APP/settings
  • 你重新部署了吗?
  • 你能显示构建日志吗? (转到 Activity 选项卡并单击最新构建旁边的查看构建日志)
  • 这是日志内容:2019-07-30T15:11:56.167929+00:00 heroku[router]: at=info code=H81 desc="Blank app" method=GET path=" /" host=countmywords.herokuapp.com request_id=81045c99-8dbf-4554-b7ee-37a2e92d7932 fwd="95.102.233.42" dyno= connect= service= status=502 bytes= protocol=https
猜你喜欢
  • 2020-08-08
  • 2021-09-22
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-11-16
  • 2016-02-10
  • 1970-01-01
相关资源
最近更新 更多