Default isolation level for transaction (@atomic) with Django and PostgreSQL
From the docs:
Like PostgreSQL itself, Django defaults to the READ COMMITTED isolation level.
Django can be configured using the database settings like this:
import psycopg2.extensions
DATABASES = {
# ...
'OPTIONS': {
'isolation_level': psycopg2.extensions.ISOLATION_LEVEL_SERIALIZABLE,
},
}
Documentation - https://docs.djangoproject.com/en/2.2/ref/databases/#isolation-level