0

Some tuples in my database need to be erased after a given time. I need my django app to check if the rows have expired.

While I can definitely write the function, how do I make Django run at everyday at a fixed time?

I have heard about Task Queues like Celery. Are they too much powerful for this? Is their anything simpler? May be something build-in?

Buggy Coder
  • 373
  • 5
  • 16

2 Answers2

2

Use a simple cron job to trigger a custom Django management command.

Daniel Roseman
  • 567,968
  • 59
  • 825
  • 842
-1

Use a threading.Thread to schedule a continuous event loop. In your thread, use time.sleep to create a gap before the next occurrence of the event.

Malik Brahimi
  • 15,933
  • 5
  • 33
  • 65
  • IMO, thread based approach is a resource hog - management commands or some schedulers like redis, etc are better. – karthikr Jan 21 '15 at 20:40