gpt4 book ai didi

django - 无法在heroku上启动gunicorn(Django Node应用程序)错误: Connection in use: ('0.0.0.0' , 46831)

转载 作者:太空宇宙 更新时间:2023-11-03 21:57:51 25 4
gpt4 key购买 nike

我正在尝试在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 url 不起作用。

我的 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 提供服务。

关于django - 无法在heroku上启动gunicorn(Django Node应用程序)错误: Connection in use: ('0.0.0.0' , 46831),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35685889/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com