【问题标题】:Deploying django app with heroku -- gunicorn not installing使用 heroku 部署 django 应用程序 - gunicorn 未安装
【发布时间】:2015-01-08 06:57:55
【问题描述】:

我正在尝试部署一个简单的 Django 应用程序。我有一个 requirements.txt 文件,其中声明了许多依赖项。当我推送到 heroku 时,它说它正在安装我声明的依赖项:

Downloading/unpacking gunicorn==19.1.1 (from -r requirements.txt (line 9))
Running setup.py (path:/tmp/pip_build_u52128/gunicorn/setup.py) egg_info for package   gunicorn

但是,当我运行命令“heroku ps:scale web=1”时(按照 heroku 教程中的建议),我得到以下输出:

Scaling dynos... done, now running web at 1:1X.

当我检查“heroku ps”时,我得到以下输出:

=== web (1X): gunicorn poem_maker.wsgi:application
web.1: crashed 2015/01/08 10:46:14 (~ 3m ago)

查看日志,我看到以下输出:

2015-01-08T06:46:14.481013+00:00 heroku[web.1]: Starting process with command gunicorn poem_maker.wsgi:application
2015-01-08T06:46:15.214361+00:00 app[web.1]: bash: gunicorn: command not found

在我看来,我这样做是正确的——应该找到 gunicorn 命令!

谢谢,

院长

【问题讨论】:

  • 你的 Procfile 是什么样的?
  • @DanielRoseman 我的 Procfile 中唯一的一行如下: web: gunicornpoem_maker.wsgi
  • 你能试试bin/gunicorn吗?
  • @DanielRoseman 我在我的 Procfile 中将 'gunicorn' 替换为 'bin/gunicorn',得到以下输出:bash: bin/gunicorn: No such file or directory
  • 你能分享更多的 pip 安装日志吗?最后总结了安装的内容 - gunicorn 在那里?

标签: django heroku gunicorn


【解决方案1】:

我认为问题在于您运行时 Procfile 中的这一行

gunicorn poem_maker.wsgi:application

改用web: gunicorn poem_maker.wsgi

【讨论】:

    【解决方案2】:

    这个错误说明你缺少gunicorn,安装它

    pip install gunicorn
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-11-03
      • 2014-10-16
      • 2018-02-04
      • 2019-09-19
      • 2020-10-26
      • 2018-10-18
      • 2017-12-01
      • 2020-04-24
      相关资源
      最近更新 更多