开发者

django-notifications not sending any email

开发者 https://www.devze.com 2023-01-23 13:30 出处:网络
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:

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=()
rele开发者_运维技巧asing 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.


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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消