Regarding a weekly scheduled task, the most straightforward approach might be to create a new custom management command, and have a cron or Windows Task Scheduler call that command. This actually already has an answer here, along with other possible options for you to consider:
Django - Set Up A Scheduled Job?
Note: If you're using a virtualenv, make sure to have the cron call the management command via the python
binary in the virtualenv, not the one in the system path.
As for a triggered action based on an application event or condition, two thoughts:
- You could set up a listener for a post-save signal on your model. When the signal is received, the email could be sent via the receiver. You can read up on signals here.
- Django's send_mail email wrapper is straightforward enough that you could also use that directly in your view.