将Dynos添加到Django/Heroku项目的正确方法是什么?

发布于 2025-02-02 06:15:47 字数 1112 浏览 4 评论 0 原文

这是我以前的问题的延续:

当前我有错误代码= H14 desc =“无网络进程运行” wihch表明没有dynos。我试图通过执行 heroku ps:scale web = 1 来解决此问题,但会出现错误:缩放dynos ...! ▸找不到该过程类型(Web)。。此答案建议“通过Heroku dashboard simple Disable/启用”。但是,我看不到任何方法可以做到这一点。其他一些可能的解决方案表明,问题在于procfile,其位置或内容。

这是我的procfile,

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

这是我的文件夹结构:

folder my_project
│   requirements.txt
│   runtime.txt
│   folder .git
│   folder my_project-env
│
└───folder my_project
│   │   folder my_project (main Django app)
│   │   folder django app 1
│   │   folder django app 2
│   │   manage.py
│   │   Procfile

编辑:

我还尝试在hierarcy中移动一个文件夹(与需求.txt相同)。同时,将procfile引用更改为 my_project.my_project.wsgi 。这导致了Dynos的可用性,因此有些不正确,但随后出现了错误: Gunicorn.errors.haltserver:< haltserver“工人未能启动。” 3>

This is continuation of my previous question: What is the propper way to debug gunicorn?

Currently I am having error code=H14 desc="No web processes running" wihch suggests that there are no dynos. I tried to fix this by doing heroku ps:scale web=1, but instead got error: Scaling dynos... ! ▸ Couldn't find that process type (web).. This answer suggests "simple disable/enable through heroku dashboard". However I can't see any way I can do that. Some other possible solutions suggested that the problem is with the Procfile, its location or its content.

Here is my Procfile

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

Here is my folder structure:

folder my_project
│   requirements.txt
│   runtime.txt
│   folder .git
│   folder my_project-env
│
└───folder my_project
│   │   folder my_project (main Django app)
│   │   folder django app 1
│   │   folder django app 2
│   │   manage.py
│   │   Procfile

EDIT:

I also tried moving Procfile one folder up in hierarcy (to same as requirements.txt). At the same time changed Procfile reference to my_project.my_project.wsgi. This resulted in dynos to be available so something went right, but then got error: gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>

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

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

发布评论

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

评论(1

自在安然 2025-02-09 06:15:47

unignts.txt runtime.txt 移动到 manage.py.py procfile 的位置您的文件夹结构是因为,它们都必须处于项目根部。

我也希望 kauppalista.wsgi 指向 MAIN DJANGO APP
例如,从您提供的文件夹结构中,将在此位置内找到 wsgi.py 文件:文件夹my_project&gt;文件夹my_project&gt;文件夹my_project(称为kauppalista的主Django应用)。因此, procfile 将是;

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

web: gunicorn kauppalista.wsgi

运行 HEROKU PS 命令还应帮助您确定更改后确定Dynos的状态。在情况下,它说'app'no dyno',只需通过loggin通过您的Web浏览器通过loggin禁用/启用dynos。

记住要添加,提交并将您的更改推向Heroku。

Move the requirements.txt and the runtime.txt to the location where manage.py and Procfile is found in your folder structure because, they are all required to be in the project root....
See here

I also hope that the kauppalista.wsgi points to the main Django app.
For instance, from the folder structure you provided, the wsgi.py file would be found inside this location: folder my_project > folder my_project > folder my_project(main Django app called kauppalista). So the Procfile would be;

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

OR

web: gunicorn kauppalista.wsgi

Running the heroku ps command should also help you to determine the state of the dynos after you apply the changes. In the case it says 'no dyno on app', simply disable/enable dynos through the heroku dashboard by loggin in via your web browser.

Remember to add, commit and push your changes to heroku.

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