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?

BugBreeder
  • 85
  • 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
  • I've had this issue, to help address it, I developed a service scheduledwebhook.com. It allows you to specify when an event should be triggered and the destination for the data. If this sounds like it might meet your needs, check it out. – Garrett Barlocker May 26 '23 at 00:15

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
  • 2,196
  • 3
  • 30
  • 53