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?
精彩评论