Reputation: 2765
On a custom django app I'd like to send notification email on many events, e.g. when a user's comment is being liked or comment is posted on her profile. However I am worried that this will have scaling implications for the app so I am wondering what is the best way to do it so that it does not block the views.
Upvotes: 2
Views: 84
Reputation: 20838
Use Django-Celery
to put it in a Task Queue, that way it all happens in the background.
http://celery.readthedocs.org/en/latest/django/first-steps-with-django.html
Here is a good video link on how to use Celery with Django:
https://godjango.com/63-deferred-tasks-and-scheduled-jobs-with-celery-31-django-17-and-redis/
Upvotes: 2