I have a view like"
def MyView(request):
SendMyMail(args)
and my SendMymail is:
def SendMymail(args):
send_mail(title, content, sender, receiver)
Here I want to queue the message sending process if there is so many messages. I have gone through document of celery and understood the base.
I have seen in many examples people are creating task.py file where they define the task with period. I want to know what to write in view then.
Can anyone give me clear example how can I accomplish of sending multiple emails
OK, I'll give you an example to get you going. Use celery to send a mail async.
then in tasks.py
To use celerybeat, you can set up the task to run periodically from your celery.conf file, or use a third party app to help, I use django-celery, as you can set the periodic tasks from the admin.