Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django/Python email notification for events

I work on a page in Django, where users can set custom reminders for different dates (max. 3 per date). The reminders should send via e-mail. Its similar to Google Calendar, where you can set multiple reminders for each event in x-minutes, x-hour or x-days before the date starts. I wonder, how I can solve it combined with Django. Since there will be a lot of users and dates, which should of course also run perfomant. Should I do this with a cron job? Is there a python way?

like image 279
YYYY-MM-DD Avatar asked Dec 26 '12 16:12

YYYY-MM-DD


2 Answers

The other traditional way is to use django-celery: http://pypi.python.org/pypi/django-celery/

You can use the celerybeat command to run periodical tasks. Also you can start pending tasks from a django view.

like image 88
sergzach Avatar answered Sep 30 '22 19:09

sergzach


You can use a cron job. To create a management command: refer to the documentation here

Also, you can create the email generation as a queue based, distributed implementation for enhanced performance. You can use Django-mailer app for the same.

like image 35
karthikr Avatar answered Sep 30 '22 19:09

karthikr