# Where should I put background tasks in a Django project?

**URL:** <https://forum.djangoproject.com/t/where-should-i-put-background-tasks-in-a-django-project/42269>\
**Category:** Getting Started\
**Created:** [August 7, 2025, 7:07am UTC](https://forum.djangoproject.com/t/where-should-i-put-background-tasks-in-a-django-project/42269 "2025-08-07T07:07:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Suheb](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/suheb/32/29278_2.png) [@Suheb](https://forum.djangoproject.com/u/Suheb)\
**Post date:** [August 7, 2025, 7:07am UTC](https://forum.djangoproject.com/t/where-should-i-put-background-tasks-in-a-django-project/42269/1 "2025-08-07T07:07:41Z")

</div>

What is the best place or method to run tasks in Django that should happen _in the background_, not immediately on a web request?

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [August 7, 2025, 10:48am UTC](https://forum.djangoproject.com/t/where-should-i-put-background-tasks-in-a-django-project/42269/2 "2025-08-07T10:48:39Z")

</div>

[Celery](https://docs.celeryq.dev/en/stable/django/first-steps-with-django.html) is the most common suggested solution, but any background task system will work.

---

<div class="post-metadata">

**Author:** ![philgyford](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/philgyford/32/14295_2.png) [@philgyford](https://forum.djangoproject.com/u/philgyford)\
**Post date:** [August 7, 2025, 12:49pm UTC](https://forum.djangoproject.com/t/where-should-i-put-background-tasks-in-a-django-project/42269/3 "2025-08-07T12:49:32Z")

</div>

A couple of alternatives to Celery:

- [GitHub - django-q2/django-q2: A multiprocessing distributed task queue for Django based on Django-Q](https://github.com/django-q2/django-q2)
- [GitHub - coleifer/huey: a little task queue for python](https://github.com/coleifer/huey)

I’ve only used django-q2 and it was fine for my simple uses (running management commands periodically).

---

<div class="post-metadata">

**Author:** ![czue](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/czue/32/1387_2.png) [@czue](https://forum.djangoproject.com/u/czue)\
**Post date:** [August 9, 2025, 9:36am UTC](https://forum.djangoproject.com/t/where-should-i-put-background-tasks-in-a-django-project/42269/4 "2025-08-09T09:36:14Z")

</div>

This is mostly just FYI, but there is [an accepted DEP to add background tasks natively](https://github.com/django/deps/blob/main/accepted/0014-background-workers.rst) and a reference implementation called [django-tasks](https://github.com/RealOrangeOne/django-tasks). I don’t know offhand what the current status of that project is, or what the timeline for tasks being added to core is, but it might be something to look at if you want to know what the expected “official” answer will be eventually.

That said, for a project starting today, using celery or one of the alternatives that are already in use is probably a safer bet.
