调试枪支的支撑杆是什么?

发布于 2025-02-03 01:54:27 字数 523 浏览 4 评论 0原文

我正在尝试在Heroku上部署我的第一个Django应用程序。 Gunicorn给了我这个错误:Gunicorn.Errors.haltserver:< haltserver“工人未能启动。” 3>

在此答案中 https://stackoverflow.com/a/555623889 命令Gunicorn App -preload -b 0.0.0.0.0:5000被称为详细的错误消息,但是由于其注释声明,尚不清楚用什么替换的单词。例如,我在某个地方看到了类似的东西,称为<我的应用程序的名称> .wsgi。使我的Django应用程序中的更糟糕的名称与Heroku上的应用不同。

同样,如果我从终端(在虚拟env中)中称其为海峡,或者我应该使用某种枪支CLI,这对我来说还不清楚。

那么,弄清楚什么是失败的枪手的实际propper方法是什么?

I am trying to deploy my very first Django applicatin on heroku. Gunicorn gives me this error: gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>

In this answer https://stackoverflow.com/a/55623889 command gunicorn app:application --preload -b 0.0.0.0:5000 is said to give detailed error message, but as its comments state it is not clear what words to replace with what. For instance somewhere I saw something similar called with <name of my app>.wsgi. To make matter worse name of my Django app in local is different from the one on Heroku.

Also it is not clear to me should this be called strait from terminal (within virtual env) or should I be using some sort of gunicorn CLI.

So what is the actual propper way to figure out what is failing gunicorn?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

耳钉梦 2025-02-10 01:54:27

过去,我遇到了类似的问题。我希望这可能会有所帮助:

  1. 确保Gunicorn通过在终端中运行pip Freeze在您的激活虚拟环境项目中安装了,以验证其安装。如果未列出,则在激活的虚拟环境中,运行pip install gunicorn,否则,如果您使用的是pipenv,请运行pipenv install install gunicorn。不要忘记通过运行pip freeze&gt;需求.txt

  2. procfile中,project> project_directory键入语法:

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

nb:应该有一个空间;

  1. - log-file-
  2. Web:Gunicorn代码的一部分。

最后,添加,提交并将更改推向Heroku服务器。

I've faced similar issues in the past. I hope this might help:

  1. Make sure gunicorn is installed in your activated virtual environment project by running pip freeze in the terminal to verify it's installation. If it is not listed, in the activated virtual environment, run pip install gunicorn or else if you are using pipenv, run pipenv install gunicorn. Don't forget to update the requirements.txt file by running pip freeze > requirements.txt

  2. In the Procfile which is within the project_directory type the syntax:

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

N.B: There should be a space between;

  1. The --log-file and the - next to it.
  2. web: and the gunicorn part of the code.

Finally add, commit and push the changes to the heroku server.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文