make connection pool

This commit is contained in:
Mohamed Nouffer
2023-05-03 18:41:58 +05:30
parent 13a5a1969f
commit 0f7cf18ecb
3 changed files with 12 additions and 2 deletions

View File

@ -91,7 +91,7 @@ WSGI_APPLICATION = 'config.wsgi.application'
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'ENGINE': 'dj_db_conn_pool.backends.postgresql',
'NAME': env("POSTGRES_DBNAME"),
'USER': env("POSTGRES_USER"),
'PASSWORD': env("POSTGRES_PASS"),
@ -100,6 +100,15 @@ DATABASES = {
}
}
DATABASES = {
'default': {
'POOL_OPTIONS' : {
'POOL_SIZE': 200,
'MAX_OVERFLOW': 10,
'RECYCLE': 24 * 60 * 60
}
}
}
# Password validation
# https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators