Unable to start gunicorn(Django Node app) on heroku Error : Connection in use: ('0.0.0.0', 46831)

Unable to start gunicorn(Django Node app) on heroku Error : Connection in use: ('0.0.0.0', 46831)

我正在尝试在 heroku 上托管 Django Node 应用程序。我的 procfile 看起来像这样

web: gunicorn backend courier.wsgi:application --bind 0.0.0.0:$PORT & node frontend/server.js

我的 server.js 运行 index.html。我的正在显示 index.html 页面。但是 Django 网址不起作用。

我的 heroku 日志显示了这一点。

    2016-02-28T17:25:40.032724+00:00 app[web.1]: [2016-02-28 17:25:40 +0000] [7] [INFO] Starting gunicorn 19.3.0
    2016-02-28T17:25:40.258117+00:00 heroku[web.1]: State changed from starting to up
    2016-02-28T17:25:41.042335+00:00 app[web.1]: [2016-02-28 17:25:41 +0000] [7] [ERROR] Connection in use: ('0.0.0.0', 46831)
    2016-02-28T17:25:41.042419+00:00 app[web.1]: [2016-02-28 17:25:41 +0000] [7] [ERROR] Retrying in 1 second.

我的 gunicorni 没有启动。

但是,当我从我的 procfile 中删除 & node frontend/server.js 时,它会正常运行 Django 应用程序并且我所有的 Django URL 都可以工作。

如果有人能告诉我这里出了什么问题,那就太好了。提前致谢。

我认为您不能在单个 heroku dyno 上为两个不同的进程设置两个端口。

您可能需要使用另一个测功机来 运行 另一个。

我还建议将前端页面作为静态文件并通过 Django 提供。