1
这是我第一次使用django信号,我想挂钩评论应用程序提供的“comment_was_flagged”信号,以在评论被标记时通知我。Django“comment_was_flagged”信号
这是我的代码,但它似乎没有工作,我错过了什么?
from django.contrib.comments.signals import comment_was_flagged
from django.core.mail import send_mail
def comment_flagged_notification(sender, **kwargs):
send_mail('testing moderation', 'testing', '[email protected]', ['[email protected]',])
comment_was_flagged.connect(comment_flagged_notification)
(我只是测试的电子邮件了,但我已经向电子邮件正常发送。)
谢谢!