mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-27 02:48:38 -06:00
Introduce DATABASE_ROUTERS config parameter
This commit is contained in:
parent
1db1ea285b
commit
d7d4b06808
@ -46,7 +46,7 @@ DATABASES = {
|
||||
}
|
||||
```
|
||||
|
||||
NetBox itself requires only a `default` database be defined. However, certain plugins may require the configuration of additional databases.
|
||||
NetBox itself requires only that a `default` database is defined. However, certain plugins may require the configuration of additional databases. (Consider also configuring the [`DATABASE_ROUTERS`](./system.md#database_routers) parameter when multiple databases are in use.)
|
||||
|
||||
The following parameters must be defined for each database:
|
||||
|
||||
|
@ -12,6 +12,14 @@ BASE_PATH = 'netbox/'
|
||||
|
||||
---
|
||||
|
||||
## DATABASE_ROUTERS
|
||||
|
||||
Default: `[]` (empty list)
|
||||
|
||||
An iterable of [database routers](https://docs.djangoproject.com/en/stable/topics/db/multi-db/) to use for automatically selecting the appropriate database(s) for a query. This is useful only when [multiple databases](./required-parameters.md#databases) have been configured.
|
||||
|
||||
---
|
||||
|
||||
## DEFAULT_LANGUAGE
|
||||
|
||||
Default: `en-us` (US English)
|
||||
|
@ -88,6 +88,7 @@ CSRF_COOKIE_SECURE = getattr(configuration, 'CSRF_COOKIE_SECURE', False)
|
||||
CSRF_TRUSTED_ORIGINS = getattr(configuration, 'CSRF_TRUSTED_ORIGINS', [])
|
||||
DATA_UPLOAD_MAX_MEMORY_SIZE = getattr(configuration, 'DATA_UPLOAD_MAX_MEMORY_SIZE', 2621440)
|
||||
DATABASE = getattr(configuration, 'DATABASE', None) # Legacy DB definition
|
||||
DATABASE_ROUTERS = getattr(configuration, 'DATABASE_ROUTERS', [])
|
||||
DATABASES = getattr(configuration, 'DATABASES', {'default': DATABASE})
|
||||
DEBUG = getattr(configuration, 'DEBUG', False)
|
||||
DEFAULT_DASHBOARD = getattr(configuration, 'DEFAULT_DASHBOARD', None)
|
||||
|
Loading…
Reference in New Issue
Block a user