Compare commits

..

4 commits

Author SHA1 Message Date
waja ae17c60de0
Merge 7c22dd8656 into 1d8a31be83 2025-08-05 07:06:10 -04:00
Tobias Genannt 1d8a31be83
Merge pull request #1495 from CompPhy/database-syntax-fix
Some checks failed
push / Checks syntax of our code (push) Has been cancelled
push / Builds new NetBox Docker Images (./build-latest.sh, ubuntu-24.04) (push) Has been cancelled
push / Builds new NetBox Docker Images (./build-latest.sh, ubuntu-24.04-arm) (push) Has been cancelled
push / Builds new NetBox Docker Images (./build.sh feature, ubuntu-24.04) (push) Has been cancelled
push / Builds new NetBox Docker Images (./build.sh feature, ubuntu-24.04-arm) (push) Has been cancelled
push / Builds new NetBox Docker Images (./build.sh main, ubuntu-24.04) (push) Has been cancelled
push / Builds new NetBox Docker Images (./build.sh main, ubuntu-24.04-arm) (push) Has been cancelled
push / Builds new NetBox Docker Images (PRERELEASE=true ./build-latest.sh, ubuntu-24.04) (push) Has been cancelled
push / Builds new NetBox Docker Images (PRERELEASE=true ./build-latest.sh, ubuntu-24.04-arm) (push) Has been cancelled
Support new DATABASES syntax in Netbox 4.3
2025-08-05 07:19:46 +02:00
Kelly Shutt 109ef8afd2 Update DATABASES syntax. 2025-08-04 13:10:06 -04:00
Tobias Genannt 477decd80a
Merge pull request #1450 from netbox-community/develop
Version 3.3.0
2025-05-05 07:51:26 +02:00

View file

@ -64,19 +64,21 @@ if '*' not in ALLOWED_HOSTS and 'localhost' not in ALLOWED_HOSTS:
# PostgreSQL database configuration. See the Django documentation for a complete list of available parameters: # PostgreSQL database configuration. See the Django documentation for a complete list of available parameters:
# https://docs.djangoproject.com/en/stable/ref/settings/#databases # https://docs.djangoproject.com/en/stable/ref/settings/#databases
DATABASE = { DATABASES = {
'NAME': environ.get('DB_NAME', 'netbox'), # Database name 'default': {
'USER': environ.get('DB_USER', ''), # PostgreSQL username 'NAME': environ.get('DB_NAME', 'netbox'), # Database name
'PASSWORD': _read_secret('db_password', environ.get('DB_PASSWORD', '')), 'USER': environ.get('DB_USER', ''), # PostgreSQL username
# PostgreSQL password 'PASSWORD': _read_secret('db_password', environ.get('DB_PASSWORD', '')),
'HOST': environ.get('DB_HOST', 'localhost'), # Database server # PostgreSQL password
'PORT': environ.get('DB_PORT', ''), # Database port (leave blank for default) 'HOST': environ.get('DB_HOST', 'localhost'), # Database server
'OPTIONS': {'sslmode': environ.get('DB_SSLMODE', 'prefer')}, 'PORT': environ.get('DB_PORT', ''), # Database port (leave blank for default)
# Database connection SSLMODE 'OPTIONS': {'sslmode': environ.get('DB_SSLMODE', 'prefer')},
'CONN_MAX_AGE': _environ_get_and_map('DB_CONN_MAX_AGE', '300', _AS_INT), # Database connection SSLMODE
# Max database connection age 'CONN_MAX_AGE': _environ_get_and_map('DB_CONN_MAX_AGE', '300', _AS_INT),
'DISABLE_SERVER_SIDE_CURSORS': _environ_get_and_map('DB_DISABLE_SERVER_SIDE_CURSORS', 'False', _AS_BOOL), # Max database connection age
# Disable the use of server-side cursors transaction pooling 'DISABLE_SERVER_SIDE_CURSORS': _environ_get_and_map('DB_DISABLE_SERVER_SIDE_CURSORS', 'False', _AS_BOOL),
# Disable the use of server-side cursors transaction pooling
}
} }
# Redis database settings. Redis is used for caching and for queuing background tasks such as webhook events. A separate # Redis database settings. Redis is used for caching and for queuing background tasks such as webhook events. A separate