Django Tasks
An implementation and backport of background workers and tasks in Django, as defined in DEP 0014.
Warning: This package is under active development, and breaking changes may be released at any time. Be sure to pin to specific versions if you're using this package in a production environment.
Installation
python -m pip install django-tasks
The first step is to add django_tasks to your INSTALLED_APPS.
INSTALLED_APPS = [
"django_tasks",
]
Secondly, you'll need to configure a backend. This connects the tasks to whatever is going to execute them.
If omitted, the following configuration is used:
TASKS = {
"default": {
"BACKEND": "django_tasks.backends.immediate.ImmediateBackend"
}
}
A few backends are included by default:
django_tasks.backends.dummy.DummyBackend: Don't execute the tasks, just store them. This is especially useful for testing.
django_tasks.backends.immediate.ImmediateBackend: Execute the task immediately in the current threa
|