'My local django project works, and it also works on Heroku until i submit form and then i get error when it works fine locally
I have a website with an email form and when i submit locally it works. When i submit form on heroku i got a 500 server error or an application error. What can i do??
2022-02-02T01:30:06.285140+00:00 app[web.1]: response = response or self.get_response(reque
st)
2022-02-02T01:30:06.285140+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-p
ackages/django/core/handlers/exception.py", line 49, in inner
2022-02-02T01:30:06.285140+00:00 app[web.1]: response = response_for_exception(request, exc
)
2022-02-02T01:30:06.285140+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-p
ackages/django/core/handlers/exception.py", line 103, in response_for_exception
2022-02-02T01:30:06.285141+00:00 app[web.1]: response = handle_uncaught_exception(request,
get_resolver(get_urlconf()), sys.exc_info())
2022-02-02T01:30:06.285141+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-p
ackages/django/core/handlers/exception.py", line 47, in inner
2022-02-02T01:30:06.285141+00:00 app[web.1]: response = get_response(request)
2022-02-02T01:30:06.285141+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-p
ackages/django/core/handlers/base.py", line 179, in _get_response
2022-02-02T01:30:06.285142+00:00 app[web.1]: response = wrapped_callback(request, *callback
_args, **callback_kwargs)
2022-02-02T01:30:06.285142+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-p
ackages/django/views/generic/base.py", line 70, in view
2022-02-02T01:30:06.285143+00:00 app[web.1]: return self.dispatch(request, *args, **kwargs)
2022-02-02T01:30:06.285143+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-p
ackages/django/views/generic/base.py", line 98, in dispatch
2022-02-02T01:30:06.285143+00:00 app[web.1]: return handler(request, *args, **kwargs)
2022-02-02T01:30:06.285143+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-p
ackages/django/views/generic/edit.py", line 142, in post
2022-02-02T01:30:06.285144+00:00 app[web.1]: return self.form_valid(form)
2022-02-02T01:30:06.285144+00:00 app[web.1]: File "/app/mainpage/views.py", line 30, in for
m_valid
2022-02-02T01:30:06.285144+00:00 app[web.1]: send_mail(
2022-02-02T01:30:06.285144+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-p
ackages/django/core/mail/__init__.py", line 61, in send_mail
2022-02-02T01:30:06.285145+00:00 app[web.1]: return mail.send()
2022-02-02T01:30:06.285145+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-p
ackages/django/core/mail/message.py", line 284, in send
2022-02-02T01:30:06.285146+00:00 app[web.1]: return self.get_connection(fail_silently).send
_messages([self])
2022-02-02T01:30:06.285149+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-p
ackages/django/core/mail/backends/smtp.py", line 109, in send_messages
2022-02-02T01:30:06.285149+00:00 app[web.1]: sent = self._send(message)
2022-02-02T01:30:06.285149+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-p
ackages/django/core/mail/backends/smtp.py", line 125, in _send
2022-02-02T01:30:06.285149+00:00 app[web.1]: self.connection.sendmail(from_email, recipient
s, message.as_bytes(linesep='\r\n'))
2022-02-02T01:30:06.285150+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/smtpli
b.py", line 885, in sendmail
2022-02-02T01:30:06.285150+00:00 app[web.1]: raise SMTPSenderRefused(code, resp, from_addr)
2022-02-02T01:30:06.285157+00:00 app[web.1]: smtplib.SMTPSenderRefused: (530, b'5.7.0 Authe
ntication Required. Learn more at\n5.7.0 https://support.google.com/mail/?p=WantAuthError
q12sm3066050qtx.51 - gsmtp', '****@gmail.com')
2022-02-02T01:30:06.286017+00:00 heroku[router]: at=error code=H13 desc="Connection closed
without response" method=POST path="/" host=andregrandon.herokuapp.com request_id=f8b141a4-
de3c-453c-89f9-4a4697c4de57 fwd="76.69.37.221" dyno=web.1 connect=0ms service=146ms status=
503 bytes=0 protocol=https
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
