adds ENGINE to database config #11791

This commit is contained in:
Abhimanyu Saharan 2023-05-04 03:24:11 +05:30
parent 01fa6e28cd
commit f9b831ab7e
2 changed files with 11 additions and 9 deletions

View File

@ -13,6 +13,7 @@ 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 = { DATABASE = {
'ENGINE': 'django.db.backends.postgresql', # Database engine
'NAME': 'netbox', # Database name 'NAME': 'netbox', # Database name
'USER': '', # PostgreSQL username 'USER': '', # PostgreSQL username
'PASSWORD': '', # PostgreSQL password 'PASSWORD': '', # PostgreSQL password

View File

@ -182,15 +182,16 @@ if RELEASE_CHECK_URL:
# Database # Database
# #
# Only PostgreSQL is supported if 'ENGINE' not in DATABASE:
if METRICS_ENABLED: # Only PostgreSQL is supported
DATABASE.update({ if METRICS_ENABLED:
'ENGINE': 'django_prometheus.db.backends.postgresql' DATABASE.update({
}) 'ENGINE': 'django_prometheus.db.backends.postgresql'
else: })
DATABASE.update({ else:
'ENGINE': 'django.db.backends.postgresql' DATABASE.update({
}) 'ENGINE': 'django.db.backends.postgresql'
})
DATABASES = { DATABASES = {
'default': DATABASE, 'default': DATABASE,