Imagine a situation in which a user performs an action on a website and admins are notified. Imagine there are 20 admins to notify. By using normal methods for sending emails wi
Use celery as a task queue and django-celery-email which is an Django e-mail backend that dispatches e-mail sending to a celery task.
A thread may be a possible solution. I use threads intensively in my application for haevy tasks.
# This Python file uses the following encoding: utf-8
#threading
from threading import Thread
...
class afegeixThread(Thread):
def __init__ (self,usuari, parameter=None):
Thread.__init__(self)
self.parameter = parameter
...
def run(self):
errors = []
try:
if self.paramenter:
....
except Exception, e:
...
...
n = afegeixThread( 'p1' )
n.start()
Another option is django-mailer. It queues up mail in a database table and then you use a cron job to send them.
https://github.com/pinax/django-mailer