Py学习  »  Django

Django Heroku H10 error method=获取路径=“/favicon.ico”

MarcinSzyc • 6 年前 • 2471 次点击  

当我试图将Django应用程序发送到Heroku时,我正在与这个错误进行斗争。

以下是一些细节:

要求:

dj-database-url==0.5.0
Django==2.1.5
django-heroku==0.3.1
gunicorn==19.9.0
psycopg2==2.7.7
psycopg2-binary==2.7.6.1
pytz==2018.9
whitenoise==4.1.2

华尔街日报:

import os

from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "folder.settings")

application = get_wsgi_application()

已尝试Procfile(以下是我在单独的文件/部署中使用的选项):

web: gunicorn 4_Django/folder/wsgi.py 0.0.0.0:$PORT

日志:

Procfile日志:

2019-01-29T14:18:23.785257+00:00 heroku[web.1]: Starting process with 
command `gunicorn 4_Django/folder/wsgi.py 0.0.0.0:8023`
2019-01-29T14:18:26.388317+00:00 heroku[web.1]: State changed from 
starting to crashed
2019-01-29T14:18:26.307448+00:00 heroku[web.1]: Process exited with 
status 3
2019-01-29T14:18:27.000000+00:00 app[api]: Build succeeded
2019-01-29T14:18:32.222748+00:00 heroku[router]: at=error code=H10 
desc="App crashed" method=GET path="/favicon.ico" 
host=djangozadanie.herokuapp.com request_id=7102a7b5-2798-4317-988d- 
a690c10c9a14 fwd="89.78.65.77" dyno= connect= service= status=503 
bytes= protocol=https

在部署过程中,我得到了如下十几条线路,但我不确定这是否与问题有关:

Found another file with the destination path 'style.css'. It will be 
ignored since only the first encountered file is collected. If this is 
not what you want, make sure every static file has a unique path.
Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/52070
文章 [ 1 ]  |  最新文章 6 年前
Daniel Roseman
Reply   •   1 楼
Daniel Roseman    7 年前

那不是你用枪的方式。它接受Python模块路径,而不是文件路径,并且不接受命令行上的IP或端口。

作为 the docs 秀,其实你只需要:

web: gunicorn folder.wsgi

假设 folder 是您的项目名称。