0

I would like to run a particular function (let's say to delete a post) at a specific time in the future (e.g.: at 10am) only once based on a condition.

I am using Django, and I was thinking about using cron or python-crontab, but it seems that these task schedulers can only be used when a particular task has to be executed more than once in the future. As I was trying to use the python-crontab with Django, I also did not find any resources that allow me to execute "this task of deleting a post at 10am tomorrow only if a user does a particular action", for example.

Does anyone know if I can still use python-crontab? Or other technology should be used?

Mauricio
  • 75
  • 2
  • 10
  • This may help: [Django - Set Up A Scheduled Job?](https://stackoverflow.com/questions/573618/django-set-up-a-scheduled-job) – Asif Akhtar May 25 '19 at 21:42

1 Answers1

0

I would use:

https://github.com/celery/django-celery-beat

http://docs.celeryproject.org/en/latest/getting-started/first-steps-with-celery.html

Celery to run background tasks, and celery beat is a scheduler to kick off the background tasks at the specified times.

vrtx54234
  • 1,964
  • 3
  • 28
  • 48