0

I'm getting server error(500) after I set DEBUG to False, both in local and after deploying to Heroku. Everything is Ok when DEBUG mode is True.

Thanks for help

Arthur
  • 109
  • 8

2 Answers2

1

I think you need to configure your logging and mail correctly so you see what exactly is happening.

https://docs.djangoproject.com/en/3.0/topics/email/

Mail is sent using the SMTP host and port specified in the EMAIL_HOST and EMAIL_PORT settings. The EMAIL_HOST_USER and EMAIL_HOST_PASSWORD settings, if set, are used to authenticate to the SMTP server, and the EMAIL_USE_TLS and EMAIL_USE_SSL settings control whether a secure connection is used.

https://docs.djangoproject.com/en/3.0/topics/logging/#django.utils.log.RequireDebugFalse

'filters': { 'require_debug_false': { '()': 'django.utils.log.RequireDebugFalse', } }, 'handlers': { 'mail_admins': { 'level': 'ERROR', 'filters': ['require_debug_false'], 'class': 'django.utils.log.AdminEmailHandler' } },

edilio
  • 1,778
  • 14
  • 13
0

Thanks for the answers, I have found the solution, the issue was with html template {% static %} tag.

I had such line

  • link rel="shortcut icon" href="{% static 'assets/images/39-1109688-140x140.png' type="image/x-icon' %}"

but the closing %} must be in front of type

  • link rel="shortcut icon" href="{% static 'assets/images/39-1109688-140x140.png' %}" type="image/x-icon"
Arthur
  • 109
  • 8