Skip to content

Commit 7e0ec66

Browse files
authored
Merge pull request #78 from kraken-tech/meshy/docs/settings
Document our custom Django settings
2 parents 46bcd9e + 912c06f commit 7e0ec66

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

docs/reference/settings.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Settings
2+
3+
Django Subatomic has some custom [Django settings][django-settings]
4+
to help with the process of adopting it in existing projects.
5+
6+
## `SUBATOMIC_AFTER_COMMIT_NEEDS_TRANSACTION`
7+
8+
(default: `True`)
9+
10+
When this setting is `True`,
11+
[`run_after_commit`][django_subatomic.db.run_after_commit] will raise an exception if no transaction is open.
12+
13+
This setting is intended to help projects
14+
transition to this strict behaviour
15+
by getting it working in tests
16+
before enabling it in production.
17+
18+
## `SUBATOMIC_RUN_AFTER_COMMIT_CALLBACKS_IN_TESTS`
19+
20+
(default: `True`)
21+
22+
When this setting is `True`,
23+
after-commit callbacks will be run in tests
24+
when a [`transaction`][django_subatomic.db.transaction]
25+
(or [`transaction_if_not_already`][django_subatomic.db.transaction_if_not_already])
26+
context is exited.
27+
28+
This setting is intended to help projects
29+
progressively enable after-commit callbacks in tests
30+
by using [`override_settings`][override_settings]
31+
on a per-test basis.
32+
33+
[override_settings]: https://docs.djangoproject.com/en/stable/topics/testing/tools/#django.test.override_settings
34+
[django-settings]: https://docs.djangoproject.com/en/stable/topics/settings/

mkdocs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
site_name: Django-subatomic docs
22
repo_name: kraken-tech/django-subatomic
33
repo_url: https://github.com/kraken-tech/django-subatomic
4+
watch:
5+
- src
46
theme:
57
name: material
68
logo: static/img/logo.png

0 commit comments

Comments
 (0)