我正在尝试将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
WSGI:
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.
答案 0 :(得分:0)
那不是您使用枪支的方式。它接受Python模块路径,而不是文件路径,并且在命令行上不使用IP或端口。
由于the docs节目,其实都是你需要的仅仅是:
web: gunicorn folder.wsgi
假设folder
是您的项目名称。