django-notifications 不发送任何电子邮件

发布于 2024-09-30 10:59:44 字数 719 浏览 0 评论 0原文

我正在尝试使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

橘味果▽酱 2024-10-07 10:59:44

尝试用 notification.queue(..) 而不是 send_now(..) 然后 python manage.py emit_notices

try notification.queue(..) instead of send_now(..) then python manage.py emit_notices

尸血腥色 2024-10-07 10:59:44

您正在执行 send_now() 那么为什么要使用 emmit_notices 管理命令呢?

You are doing send_now() so why the emit_notices management command?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文