Skip to content

Commit

Permalink
Update settings.py
Browse files Browse the repository at this point in the history
Create a SQLITE_FILE env variable to be able to set the sqlite file somewhere else
  • Loading branch information
eric-intuitem committed Mar 12, 2024
1 parent 654defb commit 6db8e77
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion backend/ciso_assistant/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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 = [
Expand Down

0 comments on commit 6db8e77

Please sign in to comment.