views:

28

answers:

1

I have to implement a way to send automatic notification emails based on a model DateFields. I'll put an example.

I have a DateField with 2010-07-23 stored in it and I want django to send an email to a designated user when the current date reaches a week before (send it in 2010-07-16). Is there any way to accomplish this?

+3  A: 

You'll need to set up an external job, probably triggered via cron, that checks the date and sends the email as necessary.

Daniel Roseman
There's no way to trigger it through django? I can figure how to do it using django signals, but it's not efficient, if you don't do anything for a time, django will not check the dates...
Oscar Carballal
Yes, use the cron job to call a Django script. I prefer to do these as custom manage.py commands: see http://docs.djangoproject.com/en/1.2/howto/custom-management-commands/
Daniel Roseman
Thanks! I will put this as the correct answer
Oscar Carballal
It is not neccessay that cron call a django script.Simply check the time and send the email
ha22109