When does a Django application 'need' Celery or Redis? Explain the concept of decoupling a request from a long-running background task.
Last updated
You need Celery (a task queue) plus a broker like Redis when work is too slow or unreliable for the HTTP cycle: emails, reports, media processing, slow third-party APIs, or scheduled jobs (Celery Beat).
Decoupling: the view enqueues a message (e.g.
task.delay()) and responds immediately. A separate worker runs the task, so retries and failures don't break the user's request.For fast work or low volume, a management command or cron job may suffice.