How should a long-running task such as sending email be handled in a Django view?
- A Executed synchronously in the view
- B Dispatched to a task queue such as Celery
- C Run in the template
- D Deferred to the next request
Answer
Dispatched to a task queue such as Celery
Blocking the request holds a worker process and eventually times out for the user. Queues also provide retries and failure isolation.





