diff options
| author | Jake Howard <git@theorangeone.net> | 2025-07-17 12:51:09 +0100 |
|---|---|---|
| committer | nessita <124304+nessita@users.noreply.github.com> | 2025-09-16 17:28:32 -0300 |
| commit | 4289966d1b8e848e5e460b7c782dac009d746b20 (patch) | |
| tree | ef1d61a33562579d985c762036db5f7aa01406fc /docs/ref/settings.txt | |
| parent | 218f69f05eb51da1ea17d62a914a67ceff5bfd55 (diff) | |
Fixed #35859 -- Added background Tasks framework interface.
This work implements what was defined in DEP 14
(https://github.com/django/deps/blob/main/accepted/0014-background-workers.rst).
Thanks to Raphael Gaschignard, Eric Holscher, Ran Benita, Sarah Boyce,
Jacob Walls, and Natalia Bidart for the reviews.
Diffstat (limited to 'docs/ref/settings.txt')
| -rw-r--r-- | docs/ref/settings.txt | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt index c16547e72a..54957a726a 100644 --- a/docs/ref/settings.txt +++ b/docs/ref/settings.txt @@ -2766,6 +2766,82 @@ backend definition in :setting:`STORAGES`. Defining this setting overrides the default value and is *not* merged with it. +.. setting:: TASKS + +``TASKS`` +--------- + +.. versionadded:: 6.0 + +Default:: + + { + "default": { + "BACKEND": "django.tasks.backends.immediate.ImmediateBackend", + } + } + +A dictionary containing the settings for all Task backends to be used with +Django. It is a nested dictionary whose contents maps backend aliases to a +dictionary containing the options for each backend. + +The :setting:`TASKS` setting must configure a ``default`` backend; any number +of additional backends may also be specified. Depending on which backend is +used, other options may be required. The following options are available as +standard. + +.. setting:: TASKS-BACKEND + +``BACKEND`` +~~~~~~~~~~~ + +Default: ``''`` (Empty string) + +The Tasks backend to use. The built-in backends are: + +* ``'django.tasks.backends.dummy.DummyBackend'`` +* ``'django.tasks.backends.immediate.ImmediateBackend'`` + +You can use a backend that doesn't ship with Django by setting +:setting:`BACKEND <TASKS-BACKEND>` to a fully-qualified path of a backend +class (i.e. ``mypackage.backends.whatever.WhateverBackend``). + +.. setting:: TASKS-ENQUEUE_ON_COMMIT + +``ENQUEUE_ON_COMMIT`` +~~~~~~~~~~~~~~~~~~~~~ + +Default: ``True`` + +Whether to enqueue a Task only after the current transaction, if any, commits +successfully, instead of enqueueing immediately. + +This can also be configured on a per-Task basis. + +See :ref:`Task transactions <task-transactions>` for more information. + +.. setting:: TASKS-QUEUES + +``QUEUES`` +~~~~~~~~~~ + +Default: ``["default"]`` + +Specify the queue names supported by the backend. This can be used to ensure +Tasks aren't enqueued to queues which do not exist. + +To disable queue name validation, set to an empty list (``[]``). + +.. setting:: TASKS-OPTIONS + +``OPTIONS`` +~~~~~~~~~~~ + +Default: ``{}`` + +Extra parameters to pass to the Task backend. Available parameters vary +depending on the Task backend. + .. setting:: TEMPLATES ``TEMPLATES`` |
