【问题标题】:Successfully Deployed to Heroku however page is not showing anything成功部署到 Heroku 但是页面没有显示任何内容
【发布时间】:2019-03-20 00:11:34
【问题描述】:

您好,我已成功将 python django 应用程序部署到 heroku,没有任何错误。但是,当我转到链接时,它没有显示任何内容。

heroku 日志显示存在一些 H14 错误。 Procfile.txt 已添加 web: python manage.py runserver 0.0.0.0:6000

为什么页面仍然没有显示,并且显示没有 dynos 处于活动状态。

网址:https://guarded-castle-63814.herokuapp.com/

【问题讨论】:

  • 在推送到 heroku 之前,确保 django-widget-tweaks 在您的 requirements.txt 文件中。
  • 是的,这也在 requirements.txt 中,不太清楚为什么它仍然面临同样的错误
  • 嗨,好像不能用 git push heroku heroku_test:master
  • 尝试删除您的 git 存储库,重新初始化它,然后再次推送。基本上重新开始。

标签: django python-3.x heroku


【解决方案1】:

runserver 用于开发,生产使用gunicorn

过程文件

web: gunicorn config.wsgi

【讨论】:

  • 嗨,我已将其更改为您上面提到的内容,但是当我尝试执行 heroku ps:scale web=1 时,它仍然显示 Scaling dynos...! !找不到该进程类型(网络)。
  • @Gerry - 它应该是你的 project.wsgi 的名称。如果您的项目名称是 config 则上述正确,否则将 config 替换为您的项目名称并重试。
  • 是的,它已被我的项目名称替换。但我仍然面临同样的问题。我什至重新部署它,但还是一样
猜你喜欢
  • 2020-06-11
  • 1970-01-01
  • 1970-01-01
  • 2021-09-24
  • 2017-06-14
  • 2021-08-04
  • 1970-01-01
  • 1970-01-01
  • 2019-01-29
相关资源
最近更新 更多