django production server - Django not sending mail in 500 error case to ADMINS

﹥>﹥吖頭↗ 提交于 2019-12-11 06:41:38

问题


i have deployed django project finally on server and now it is working, but once i go to /admin/, i am getting 500 page but not notification.

this is what i have in settings_prod.py

from settings import *
DEBUG = TEMPLATE_DEBUG = False    
SERVER_EMAIL='my_mail@mail.com'    
DEFAULT_FROM_EMAIL='my_mail@mail.com'    
ADMINS = (
    (u'me', 'my_mail@mail.com'),
)    
MANAGERS = ADMINS

what am i doing wrong?

Do i need any SMTP setups for this? i thought, this is server mailing, so server has already everything setup to send error mails.


回答1:


OK, I got it by installing sendmail on server. for those who encounters the same problem.

apt-get install sendmail

I am in Debian.

good luck




回答2:


In the official Django documentation I quickly found the solution for my environment, Apache 2.2.22 (Debian) and Django 1.9:

https://docs.djangoproject.com/en/1.9/topics/email/#console-backend



来源:https://stackoverflow.com/questions/19634962/django-production-server-django-not-sending-mail-in-500-error-case-to-admins

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!