File tree Expand file tree Collapse file tree 3 files changed +13
-7
lines changed
Expand file tree Collapse file tree 3 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44
55[project ]
66name = " cardo-python-utils"
7- version = " 0.5.dev36 "
7+ version = " 0.5.dev37 "
88description = " Python library enhanced with a wide range of functions for different scenarios."
99readme = " README.rst"
1010requires-python = " >=3.8"
Original file line number Diff line number Diff line change @@ -35,11 +35,17 @@ MIDDLEWARE = [
3535
3636# Include the database configuration for each tenant in the DATABASES setting.
3737# You can use the get_database_configs() function from python_utils.django.db.utils as a helper.
38- DATABASES = {
39- ' tenant1' : { ... },
40- ' tenant2' : { ... },
41- ...
42- }
38+ from python_utils.django.db.utils import get_database_configs
39+
40+ for tenant, tenant_db_config in get_database_configs().items():
41+ DATABASES [tenant] = {
42+ " ENGINE" : " django.db.backends.postgresql" ,
43+ " NAME" : tenant_db_config[" name" ],
44+ " USER" : tenant_db_config[" user" ],
45+ " PASSWORD" : tenant_db_config[" password" ],
46+ " HOST" : tenant_db_config[" host" ],
47+ " PORT" : tenant_db_config.get(" port" , 5432 ),
48+ }
4349
4450# If you want to override the database alias to use for local development (when DEBUG is True).
4551# By default, the first database defined in DATABASES is used.
Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ def mock_verify_scopes_ninja():
8080 Patches AuthBearer._verify_scopes, so that no real scope checking is done during tests.
8181 This is done because scope checking uses route resolution, which the test client does not support.
8282 """
83- with patch ("python_utils.keycloak. django.api.ninja.AuthBearer._verify_scopes" ) as mock_verify :
83+ with patch ("python_utils.django.api.ninja.AuthBearer._verify_scopes" ) as mock_verify :
8484 mock_verify .return_value = None
8585 yield mock_verify
8686
You can’t perform that action at this time.
0 commit comments