我以前曾在Heroku上运行此应用程序,没有任何问题。但是,距离我部署大约6个月了,而且我还将计算机从Linux切换到Windows计算机。
现在,当我进行部署时,部署成功,但是服务无法正常工作。当我检查日志时,错误是: code = H14 desc =“没有Web进程正在运行”
我没有更改Procfile或requirements.txt,因为它一直在工作
requirements.txt:
django
gunicorn
django-heroku
requests
djangorestframework
django-cors-headers
flask-sslify
Procfile:
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
似乎没有任何改变。任何帮助,将不胜感激!
答案 0 :(得分:1)
如错误所示,您的应用程序未运行任何Web进程。 您可以使用以下命令从CLI查看所有正在运行的进程:
heroku ps -a <your app name>
并使用以下命令将您的Web进程缩放为1:
heroku ps:scale web=1 -a <your app name>
哪个将启动您的应用程序的一个实例。 参见Heroku Scaling Documentation。
答案 1 :(得分:0)
原来在与我以前不同的目录中初始化了heroku git文件。导致该应用找不到Procfile。