Import server side cursor setting from .env

This commit is contained in:
Keannu Bernasol 2024-09-04 12:46:16 +08:00
parent c74b339929
commit 24233506c4
2 changed files with 2 additions and 1 deletions

View file

@ -27,6 +27,7 @@ DB_PASSWORD = ''
DB_HOST = 'postgres' DB_HOST = 'postgres'
DB_PORT = '5432' DB_PORT = '5432'
DB_SSL_MODE = 'disable' DB_SSL_MODE = 'disable'
DB_DISABLE_SERVER_SIDE_CURSORS = 'False' # If you're using an external connection bouncer (eg. PgBouncer), set this to True
# Redis # Redis
# Used for DB cache and Celery broker # Used for DB cache and Celery broker

View file

@ -227,7 +227,7 @@ DATABASES = {
"default": { "default": {
"ENGINE": "django.db.backends.postgresql", "ENGINE": "django.db.backends.postgresql",
# Set to True to avoid issues with pgbouncer when pooling connections # Set to True to avoid issues with pgbouncer when pooling connections
'DISABLE_SERVER_SIDE_CURSORS': True, 'DISABLE_SERVER_SIDE_CURSORS': get_secret("DB_DISABLE_SERVER_SIDE_CURSORS"),
"NAME": get_secret("DB_DATABASE"), "NAME": get_secret("DB_DATABASE"),
"USER": get_secret("DB_USERNAME"), "USER": get_secret("DB_USERNAME"),
"PASSWORD": get_secret("DB_PASSWORD"), "PASSWORD": get_secret("DB_PASSWORD"),