django-notifications 不发送任何电子邮件
我正在尝试使用 django-notification 但无法让它发送任何电子邮件。通知出现在通知中,但是当我执行 python manage.py emmit_notices 时,我得到的是:
acquiring lock...
acquired.
(0.001) SELECT `notification_noticequeuebatch`.`id`, `notification_noticequeuebatch`.`pickled_data` FROM `notification_noticequeuebatch`; args=()
releasing lock...
released.
0 batches, 0 sent
done in 0.00 seconds
这是发送通知的代码:
admin = User.objects.get(id=1)
notification.send_now([amin], "order_form_created", {"from_user": admin})
通知设置看起来正确,我的用户订阅了此类通知。据我了解,该应用程序在通知批次中看起来始终为空..
编辑:看起来问题是电子邮件服务器.. 我使用了外部 SMTP 并且它有效。
I'm trying to use django-notification and I can't get it to send any emails. The notifications appears in the Notices, but when I do python manage.py emit_notices this is what I get:
acquiring lock...
acquired.
(0.001) SELECT `notification_noticequeuebatch`.`id`, `notification_noticequeuebatch`.`pickled_data` FROM `notification_noticequeuebatch`; args=()
releasing lock...
released.
0 batches, 0 sent
done in 0.00 seconds
This is the code sending the Notice:
admin = User.objects.get(id=1)
notification.send_now([amin], "order_form_created", {"from_user": admin})
Notice settings looks right, my user is subscribed to this kind of notice. From what I understand the app looks in Notification Batches, which are always empty ..
Edit: Looks like the problem was the email server .. I used an external SMTP and it worked.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试用
notification.queue(..)
而不是send_now(..)
然后 python manage.pyemit_notices
try
notification.queue(..)
instead ofsend_now(..)
then python manage.pyemit_notices
您正在执行 send_now() 那么为什么要使用 emmit_notices 管理命令呢?
You are doing send_now() so why the emit_notices management command?