Answer the question
In order to leave comments, you need to log in
Why is heroku throwing a 500 error?
I deployed a site on heroku, but when I try to go to it, I get a Server Error (500).
How to find out what's wrong? And where in general to drip?
update:
Logs from bash heroku:
2020-04-26T16:54:47.386936+00:00 app[web.1]: [2020-04-26 16:54:47 +0000] [11] [INFO] Worker exiting (pid: 11)
2020-04-26T16:54:47.386942+00:00 app[web.1]: [2020-04-26 16:54:47 +0000] [10] [INFO] Worker exiting (pid: 10)
2020-04-26T16:54:47.386943+00:00 app[web.1]: [2020-04-26 16:54:47 +0000] [4] [INFO] Handling signal: term
2020-04-26T16:54:47.487627+00:00 app[web.1]: [2020-04-26 16:54:47 +0000] [4] [INFO] Shutting down: Master
2020-04-26T16:54:53.176427+00:00 app[web.1]: [2020-04-26 16:54:53 +0000] [4] [INFO] Starting gunicorn 20.0.4
2020-04-26T16:54:53.176945+00:00 app[web.1]: [2020-04-26 16:54:53 +0000] [4] [INFO] Listening at: http://0.0.0.0:48342 (4)
2020-04-26T16:54:53.177042+00:00 app[web.1]: [2020-04-26 16:54:53 +0000] [4] [INFO] Using worker: sync
2020-04-26T16:54:53.180869+00:00 app[web.1]: [2020-04-26 16:54:53 +0000] [10] [INFO] Booting worker with pid: 10
2020-04-26T16:54:53.204875+00:00 app[web.1]: [2020-04-26 16:54:53 +0000] [11] [INFO] Booting worker with pid: 11
2020-04-26T16:54:53.865350+00:00 heroku[web.1]: State changed from starting to up
2020-04-26T16:54:55.000000+00:00 app[api]: Build succeeded
2020-04-26T16:55:13.344792+00:00 app[web.1]: 10.142.64.122 - - [26/Apr/2020:16:55:13 +0000] "GET /reviews/ HTTP/1.1" 500 145 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko/20100101 Firefox/75.0"
2020-04-26T16:55:13.344461+00:00 heroku[router]: at=info method=GET path="/reviews/" host=prqy.herokuapp.com request_id=98503209-aecc-46cb-abd1-a0f7a7870e07 fwd="188.32.33.3" dyno=web.1 connect=0ms service=145ms status=500 bytes=380 protocol=https
Answer the question
In order to leave comments, you need to log in
It wasn't easy, but I did it. On the computer in the project:
settings.py
import django_heroku
Debug = bool( os.environ.get('DJANGO_DEBUG', False) )
ALLOWED_HOSTS = ['*']
MIDDLEWARE = [
'whitenoise.middleware.WhiteNoiseMiddleware', #Добавляем до 'django.middleware.security.SecurityMiddleware',
]
EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = '[email protected]' #С которого будет приходить сообщение
EMAIL_HOST_PASSWORD = 'password'
EMAIL_PORT = 587
ADMINS = [
(''Name, '[email protected]'),
]
WHITENOISE_USE_FINDERS = True
STATIC_ROOT = None
django_heroku.settings(locals()) #В конце
Does everything work locally? Then I propose to check the spelling of the paths. This heroku junga is damn case sensitive: jpg\JPG, mp4\MP4. In your case it might be html\HTML. Thus, it considers that PHOTO.JPG, photo.JPG, photo.jpg are three different files. It helped me. Sorry, if not in this, the amateur himself)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question