1👍
✅
You can accomplish these 2 things with a package called Celery.
Celery is an asynchronous task queue/job queue based on distributed message passing.
Here’s an introduction for Django users:
http://docs.celeryproject.org/en/latest/django/first-steps-with-django.html
For Question 1 – You can execute a Periodic Task in Celery using the crontab scheduler type:
http://docs.celeryproject.org/en/latest/userguide/periodic-tasks.html#crontab-schedules
For Question 2 – I would reference the following Stack Overflow question for executing a delayed task in a model:
Django – Executing a task through celery from a model
Source:stackexchange.com