1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
|
## `TENANTS`
Default: `None`
The tenant configuration dictionary as explained in the [basic configuration](basic.md#database-configuration). A sample tenant configuration is:
```python
TENANTS = {
"public": {
"APPS": [
"django.contrib.contenttypes",
"django.contrib.staticfiles",
"django_pgschemas",
"tenants",
],
},
"www": {
"APPS": [
"django.contrib.auth",
"django.contrib.sessions",
"main",
],
"URLCONF": "main.urls",
},
"blog": {
"APPS": [
"django.contrib.auth",
"django.contrib.sessions",
"blog",
],
"URLCONF": "blog.urls",
},
"default": {
"TENANT_MODEL": "tenants.Tenant",
"APPS": [
"django.contrib.auth",
"django.contrib.sessions",
"customers",
],
"URLCONF": "customers.urls",
"CLONE_REFERENCE": "sample",
}
}
```
## `PGSCHEMAS_EXTRA_SEARCH_PATHS`
Default: `[]`
Other schemas to include in Postgres search path. You cannot include the schema for any static or dynamic tenant. The public schema is included by default, so, including it here will raise `ImproperlyConfigured`.
## `PGSCHEMAS_LIMIT_SET_CALLS`
Default: `False`
By default, the search path is set every time a database cursor is required. In some intense situations, this could ralentize the queries. Set to `True` to limit the number of calls for setting the search path.
## `PGSCHEMAS_ORIGINAL_BACKEND`
Default: `"django.db.backends.postgresql"`
The base backend to inherit from. If you have a customized backend of Postgres, you can specify it here.
## `PGSCHEMAS_PARALLEL_MAX_PROCESSES`
Default: `None`
When `--parallel` is passed in any tenant command, this setting will control the max number of processes the parallel executor can spawn. By default, `None` means that the number of CPUs will be used.
## `PGSCHEMAS_TENANT_DB_ALIAS`
Default: `"default"`
The database alias where the tenant configuration is going to take place.
## `PGSCHEMAS_PATHNAME_FUNCTION`
Default: `None`
Function that takes a schema descriptor and returns a string identifier for the schema. This identifier will be used in the `TenantFileSystemStorage` as the name of the tenant folder.
|