Skip to content

Commit 327b18d

Browse files
authored
Merge pull request #959 from NHSDigital/feat/add-django-tasks
Add Django tasks with database backend
2 parents 8581ac0 + 361409e commit 327b18d

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed

manage_breast_screening/config/settings.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ def list_env(key):
7575
"django.contrib.staticfiles",
7676
"django_extensions",
7777
"django_linear_migrations",
78+
"django_tasks",
79+
"django_tasks.backends.database",
7880
"manage_breast_screening.core",
7981
"manage_breast_screening.auth",
8082
"manage_breast_screening.users",
@@ -234,6 +236,15 @@ def list_env(key):
234236
"dicom": dicom_storage_options,
235237
}
236238

239+
TASKS = {
240+
"default": {
241+
"BACKEND": "django.tasks.backends.immediate.ImmediateBackend",
242+
},
243+
"database": {
244+
"BACKEND": "django_tasks.backends.database.DatabaseBackend",
245+
},
246+
}
247+
237248
# Password validation
238249
# https://docs.djangoproject.com/en/5.1/ref/settings/#auth-password-validators
239250

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ dependencies = [
3636
"django-ninja>=1.5.3",
3737
"ninja-put-patch-file-upload-middleware>=0.1.4",
3838
"pillow>=12.1.0",
39+
"django-tasks>=0.11.0",
3940
]
4041

4142
[dependency-groups]

uv.lock

Lines changed: 29 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)