问题
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