【问题标题】:Having trouble getting django heroku to run properly. How do I resolve error code=H14 desc="No web processes running"?无法让 django heroku 正常运行。如何解决错误代码=H14 desc="No web processes running"?
【发布时间】:2020-02-05 07:52:09
【问题描述】:

我之前在 Heroku 上运行过这个应用程序没有问题。但是自从我部署以来已经过去了大约 6 个月,我还将计算机从 Linux 切换到了 Windows 计算机。

现在当我部署时,部署成功但服务不起作用。当我检查日志时,错误是: code=H14 desc="没有网络进程在运行"

Procfile 或 requirements.txt 一直在工作,我没有更改它

requirements.txt:

django
gunicorn
django-heroku
requests
djangorestframework
django-cors-headers
flask-sslify

过程文件:

release: python manage.py migrate
web: gunicorn findtheirgifts.wsgi --log-file -

wsgi.py

"""
WSGI config for findtheirgifts project.

It exposes the WSGI callable as a module-level variable named ``application``.

For more information on this file, see
https://docs.djangoproject.com/en/2.0/howto/deployment/wsgi/
"""

import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "findtheirgifts.settings")

application = get_wsgi_application()

我已经尝试过类似主题的一些建议 heroku ps:重启 heroku buildpacks:清除 heroku ps:scale web=1

这些似乎都没有改变任何东西。对此的任何帮助将不胜感激!

【问题讨论】:

    标签: django heroku django-rest-framework


    【解决方案1】:

    如错误所示,您的应用没有运行任何 Web 进程。 您可以使用以下命令从 CLI 中查看所有正在运行的进程:

    heroku ps -a <your app name>
    

    并使用以下方法将您的 Web 进程扩展到 1:

    heroku ps:scale web=1 -a <your app name>
    

    这将启动您的应用的一个实例。 请参阅Heroku Scaling Documentation

    【讨论】:

      【解决方案2】:

      结果是在与我之前不同的目录中初始化了 heroku git 文件。导致应用找不到Procfile。

      【讨论】:

        猜你喜欢
        • 2021-10-10
        • 2021-04-07
        • 2021-03-19
        • 1970-01-01
        • 2019-02-14
        • 1970-01-01
        • 2020-12-27
        • 2021-10-17
        • 2018-08-18
        相关资源
        最近更新 更多