我的 settings.py 得到了参数:
SERVER_EMAIL = "Sit_test@tut.by"
EMAIL_HOST = "tut.by"
EMAIL_PORT = 465
EMAIL_HOST_USER = "Sit_test"
EMAIL_HOST_PASSWORD = "**********"
EMAIL_USE_SSL = True
EMAIL_USE_TLS = True
在我的models.py中,我想在编辑对象后随时单击“保存”按钮向管理员发送电子邮件:
@receiver(post_save, sender=Product)
def send_email_when_something_changed(**kwargs):
mail_admins(subject="All systems nominal.", message="Dont worry!")
print("Something has changed.")
但是当我编辑对象并单击保存时 - 浏览器会思考一会儿(一分钟或一分钟,我收到错误“[Errno 110] Connection timed out”)。设置有错误还是我的信号处理程序有问题?
谢谢