【问题标题】:Gunicorn "error: unrecognized arguments --log-file-"Gunicorn“错误:无法识别的参数--log-file-”
【发布时间】:2019-07-07 07:51:58
【问题描述】:

我启动了一个 Django 项目,它在本地计算机上运行良好。我将它部署到 Heroku 并收到此错误:

2019-07-06T10:32:11.836364+00:00 应用程序 [web.1]:gunicorn:错误: 无法识别的参数:--log-file-

2019-07-06T10:32:19.185756+00:00 应用 [web.1]:gunicorn:错误: 无法识别的参数:--log-file-

我的Procfile 包含

web: gunicorn tutorial_two.wsgi

【问题讨论】:

  • 您是否能够使用下面显示的任何答案来解决这个问题?如果是这样,请记得accept it。这会向其他用户显示您找到了解决方案。

标签: python-3.x heroku django-rest-framework


【解决方案1】:

Gunicorn 无法识别参数--log-file-。您与我们分享的Procfile 不包含类似的内容,但我会假设它实际上包含类似的内容

web: gunicorn tutorial_two.wsgi --log-file-

因为错误消息特别提到了该参数,这对于Gunicorn 几乎是正确的Procfile。问题是--log-file 应该得到一个参数 -。这些东西不应该连在一起。

修改您的Procfile 以添加空格,例如

web: gunicorn tutorial_two.wsgi --log-file -

【讨论】:

    【解决方案2】:

    嗯,这是相当隐含的。 gunicorn 程序采用 Procfile 中给出的 --log-file - 参数。可能这样的事情是正确的解决方案。

    web: gunicorn tutorial_two.wsgi; --log-file -
    

    【讨论】:

      猜你喜欢
      • 2021-01-14
      • 2015-12-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-07-28
      • 2020-03-01
      相关资源
      最近更新 更多