diff --git a/backend/ciso_assistant/settings.py b/backend/ciso_assistant/settings.py index 57a49361b..00c4e68bb 100644 --- a/backend/ciso_assistant/settings.py +++ b/backend/ciso_assistant/settings.py @@ -269,6 +269,9 @@ def set_ciso_assistant_url(_, __, event_dict): # Database # https://docs.djangoproject.com/en/4.2/ref/settings/#databases +# SQLIte file can be changed, useful for tests +SQLITE_FILE = os.environ.get('SQLITE_FILE', BASE_DIR / "db/ciso-assistant.sqlite3") + if "POSTGRES_NAME" in os.environ: DATABASES = { @@ -285,12 +288,14 @@ def set_ciso_assistant_url(_, __, event_dict): DATABASES = { "default": { "ENGINE": "django.db.backends.sqlite3", - "NAME": BASE_DIR / "db/ciso-assistant.sqlite3", + "NAME": SQLITE_FILE, "OPTIONS": { 'timeout': 120, }, } } + logger.info("SQLITE_FILE: %s", SQLITE_FILE) + logger.info("DATABASE ENGINE: %s", DATABASES["default"]["ENGINE"]) PASSWORD_HASHERS = [