diff --git a/netbox/netbox/configuration_example.py b/netbox/netbox/configuration_example.py index 4878ec520..8240a4dfb 100644 --- a/netbox/netbox/configuration_example.py +++ b/netbox/netbox/configuration_example.py @@ -13,6 +13,7 @@ ALLOWED_HOSTS = [] # PostgreSQL database configuration. See the Django documentation for a complete list of available parameters: # https://docs.djangoproject.com/en/stable/ref/settings/#databases DATABASE = { + 'ENGINE': 'django.db.backends.postgresql', # Database engine 'NAME': 'netbox', # Database name 'USER': '', # PostgreSQL username 'PASSWORD': '', # PostgreSQL password diff --git a/netbox/netbox/settings.py b/netbox/netbox/settings.py index 6608fcb8f..206b00fe7 100644 --- a/netbox/netbox/settings.py +++ b/netbox/netbox/settings.py @@ -182,15 +182,16 @@ if RELEASE_CHECK_URL: # Database # -# Only PostgreSQL is supported -if METRICS_ENABLED: - DATABASE.update({ - 'ENGINE': 'django_prometheus.db.backends.postgresql' - }) -else: - DATABASE.update({ - 'ENGINE': 'django.db.backends.postgresql' - }) +if 'ENGINE' not in DATABASE: + # Only PostgreSQL is supported + if METRICS_ENABLED: + DATABASE.update({ + 'ENGINE': 'django_prometheus.db.backends.postgresql' + }) + else: + DATABASE.update({ + 'ENGINE': 'django.db.backends.postgresql' + }) DATABASES = { 'default': DATABASE,