Skip to content

Instantly share code, notes, and snippets.

@katiayn
Last active June 27, 2024 12:19
Show Gist options
  • Save katiayn/646e9f6ae37c6471ef704d7dd9e79dc4 to your computer and use it in GitHub Desktop.
Save katiayn/646e9f6ae37c6471ef704d7dd9e79dc4 to your computer and use it in GitHub Desktop.
What's new in Django 5.1: PostgreSQL Connection Pools
# <project>/settings.py
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql",
# ...
"OPTIONS": {
"pool": {
"min_size": 2,
"max_size": 4,
"timeout": 10,
}
},
},
}
# or
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql",
# ...
"OPTIONS": {
"pool": True,
},
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment