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
  • 383
  • 5
  • 17

2 Answers2

2

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

Daniel Roseman
  • 588,541
  • 66
  • 880
  • 895
-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
  • 16,341
  • 7
  • 39
  • 70
  • 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