user12551055
user12551055

Reputation:

Django schedule task

I just need advise what is the best way to do it to schedule a task.

this is my models:

class Jobs(models.Model):
    name= models.CharField(max_length=100)
    expire =models.DateField(auto_now=False, auto_now_add=False, blank= True, null= True)

I want to delete a job after 15 days once a job expires. I can check expire and delete it problematically but I am very much confused to choose a scheduler. not getting what is the best way to schedule it.

I heard of celery, threading and a lots of things about it scheduling.

I need a expert advise, what is the best way to do this kind of task? is celery good option for me or there is any other best way to do it?

Fogive me please if i ask something amateur.

Upvotes: 0

Views: 115

Answers (1)

Taek
Taek

Reputation: 1024

It all depends on the scale of your project, celery is amazing but hard to setup and heavy. I personally use Huey in production and it does a great job. If you have a single server a crontab calling a django management command should do the trick.

Upvotes: 0

Related Questions