django生产服务器 - Django没有将500个错误情况的邮件发送到ADMINS

时间:2022-10-06 10:13:26

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.

我最终在服务器上部署了django项目,现在它正在工作,但是一旦我去/ admin /,我得到500页但没有通知。

this is what i have in settings_prod.py

这就是我在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.

我需要任何SMTP设置吗?我想,这是服务器邮件,所以服务器已经设置了所有设置来发送错误邮件。

2 个解决方案

#1


1  

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

好的,我是通过在服务器上安装sendmail得到的。对于那些遇到同样问题的人。

apt-get install sendmail

I am in Debian.

我在Debian。

good luck

#2


0  

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

在官方的Django文档中,我很快找到了适用于我的环境的解决方案,Apache 2.2.22(Debian)和Django 1.9:

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

#1


1  

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

好的,我是通过在服务器上安装sendmail得到的。对于那些遇到同样问题的人。

apt-get install sendmail

I am in Debian.

我在Debian。

good luck

#2


0  

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

在官方的Django文档中,我很快找到了适用于我的环境的解决方案,Apache 2.2.22(Debian)和Django 1.9:

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