运行应用程序时出现Heroku H10错误和语法错误

时间:2020-07-15 20:18:52

标签: python django web heroku hosting

嘿,所以我和我的朋友正在尝试举办一个黑客马拉松的网站。该网站是由django创建的,我们正尝试在heroku上托管。

我设法使它大部分都能正常工作,但是当我尝试打开网站时,它将无法正常工作。当我检查日志时,它会给我一些h10错误和一些语法错误?

我很困惑:

PROCFILE:

web: waitress-serve --listen=*:$PORT Melanoma.wsgi:application 

WSGI.py

"""
WSGI config for Melanoma 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/3.0/howto/deployment/wsgi/
"""

import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Melanoma.settings')

application = get_wsgi_application()

HEROKU记录:

2020-07-15T19:59:54.064271+00:00 heroku[web.1]: State changed from crashed to starting
2020-07-15T20:00:14.548453+00:00 heroku[web.1]: Starting process with command `waitress-serve --listen=*:50383 Melanoma.wsgi:application`
2020-07-15T20:00:16.032919+00:00 app[web.1]: Traceback (most recent call last):
2020-07-15T20:00:16.032946+00:00 app[web.1]: File "/app/.heroku/python/bin/waitress-serve", line 8, in <module>
2020-07-15T20:00:16.033071+00:00 app[web.1]: sys.exit(run())
2020-07-15T20:00:16.033071+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/waitress/runner.py", line 270, in run
2020-07-15T20:00:16.033278+00:00 app[web.1]: app = resolve(module, obj_name)
2020-07-15T20:00:16.033279+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/waitress/runner.py", line 211, in resolve
2020-07-15T20:00:16.033450+00:00 app[web.1]: obj = __import__(module_name, fromlist=segments[:1])
2020-07-15T20:00:16.033454+00:00 app[web.1]: File "/app/Melanoma/wsgi.py", line 1
2020-07-15T20:00:16.033471+00:00 app[web.1]: version https://git-lfs.github.com/spec/v1
2020-07-15T20:00:16.033487+00:00 app[web.1]: ^
2020-07-15T20:00:16.033515+00:00 app[web.1]: SyntaxError: invalid syntax
2020-07-15T20:00:16.072701+00:00 heroku[web.1]: Process exited with status 1
2020-07-15T20:00:16.109783+00:00 heroku[web.1]: State changed from starting to crashed
2020-07-15T20:15:20.344368+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=melanomai2.herokuapp.com request_id=ba0aeb51-a532-4064-a12e-29c09aa11763 fwd="24.12.151.160" dyno= connect= service= status=503 bytes= protocol=https
2020-07-15T20:15:20.582692+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=melanomai2.herokuapp.com request_id=3d488e06-9089-4c4d-a1cb-acacdad4d114 fwd="24.12.151.160" dyno= connect= service= status=503 bytes= protocol=https

我认为这可能与语法错误有关,但是当我进入wsgi.py时,第1行没有任何内容。

谢谢, MC HAMMER

0 个答案:

没有答案