Skip to content

Commit c7e9eab

Browse files
authored
Merge pull request #627 from jbernal0019/master
Add DATABASE_CONN_POOL env variables and upgrade all python libraries
2 parents ee4ff75 + bb81736 commit c7e9eab

File tree

5 files changed

+24
-18
lines changed

5 files changed

+24
-18
lines changed

chris_backend/config/settings/common.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,6 @@
119119
DATABASES = {
120120
'default': {
121121
'ENGINE': 'django.db.backends.postgresql',
122-
'OPTIONS': {
123-
'pool': True # use defaults
124-
}
125122
}
126123
}
127124

chris_backend/config/settings/local.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@
124124
DATABASES['default']['TEST'] = {'NAME': 'test_chris_dev'}
125125
DATABASES['default']['HOST'] = 'chris_dev_db'
126126
DATABASES['default']['PORT'] = '5432'
127+
DATABASES['default']['OPTIONS'] = {'pool': {'min_size': 1, 'max_size': 2, 'timeout': 10}}
127128

128129
# Mail settings
129130
# ------------------------------------------------------------------------------

chris_backend/config/settings/production.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,14 @@ def get_secret(setting, secret_type=env):
5454
DATABASES['default']['PASSWORD'] = get_secret('POSTGRES_PASSWORD')
5555
DATABASES['default']['HOST'] = get_secret('DATABASE_HOST')
5656
DATABASES['default']['PORT'] = get_secret('DATABASE_PORT')
57+
DATABASE_CONN_POOL = get_secret('DATABASE_CONN_POOL', env.bool)
58+
if DATABASE_CONN_POOL:
59+
DATABASE_CONN_POOL_MIN_SIZE = get_secret('DATABASE_CONN_POOL_MIN_SIZE', env.int)
60+
DATABASE_CONN_POOL_MAX_SIZE = get_secret('DATABASE_CONN_POOL_MAX_SIZE', env.int)
61+
DATABASE_CONN_POOL_TIMEOUT = get_secret('DATABASE_CONN_POOL_TIMEOUT', env.float)
62+
DATABASES['default']['OPTIONS'] = {'pool': {'min_size': DATABASE_CONN_POOL_MIN_SIZE,
63+
'max_size': DATABASE_CONN_POOL_MAX_SIZE,
64+
'timeout': DATABASE_CONN_POOL_TIMEOUT}}
5765

5866

5967
# STORAGE CONFIGURATION

requirements/base.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
Django==5.1.7
1+
Django==5.2.1
22
django-filter==25.1
3-
djangorestframework==3.15.2
3+
djangorestframework==3.16.0
44
django-cors-headers==4.7.0
55
psycopg[binary,pool]
66
environs==14.1.1
77
python-swiftclient==4.7.0
88
django-storage-swift==1.4.0
9-
celery==5.4.0
10-
django-celery-beat==2.7.0
9+
celery==5.5.2
10+
django-celery-beat==2.8.1
1111
python-chrisstoreclient==1.0.0
1212
python-pfconclient==3.2.0
13-
django-auth-ldap==5.1.0
13+
django-auth-ldap==5.2.0
1414
PyYAML==6.0.2
15-
whitenoise[brotli]==6.5.0
15+
whitenoise[brotli]==6.9.0
1616
PyJWT===2.10.1
17-
channels==4.2.0
18-
nats-py==2.9.0
19-
granian==1.6.1
17+
channels==4.2.2
18+
nats-py==2.10.0
19+
granian==2.2.6
2020
git+https://github.com/tfranzel/drf-spectacular.git@refs/pull/1307/head

requirements/local.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# Local development dependencies go here
22
-r base.txt
3-
django-debug-toolbar==5.0.1
4-
django-extensions==3.2.3
3+
django-debug-toolbar==5.2.0
4+
django-extensions==4.1
55
collection-json==0.1.1
6-
coverage==7.6.12
7-
pylint==3.3.4
8-
flake8==7.1.2
6+
coverage==7.8.0
7+
pylint==3.3.7
8+
flake8==7.2.0
99
isort==6.0.1
10-
pudb==2024.1.3
10+
pudb==2025.1
1111
daphne==4.1.2 # required by (django) channels.testing
1212
granian[reload]
1313
https://github.com/msbrogli/rpudb/archive/master.zip

0 commit comments

Comments
 (0)