added DATABASES setting

This commit is contained in:
Johannes Erwerle 2026-04-13 21:11:28 +02:00
parent 883e903a50
commit d4bbc36795
3 changed files with 119 additions and 13 deletions

View file

@ -6,3 +6,10 @@ BACKUP_BORG_DIR = BACKUP_HOME_DIR / "borg"
BACKUP_AUTHORIZED_KEYS = BACKUP_HOME_DIR / ".ssh" / "authorized_keys"
BACKUP_USER = "borg"
BACKUP_REPO_HOST = "backup.example.com"
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": "/path/to/the/db.sqlite3",
}
}

View file

@ -79,17 +79,6 @@ TEMPLATES = [
WSGI_APPLICATION = "community_backup.wsgi.application"
# Database
# https://docs.djangoproject.com/en/6.0/ref/settings/#databases
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": BASE_DIR / "db.sqlite3",
}
}
# Password validation
# https://docs.djangoproject.com/en/6.0/ref/settings/#auth-password-validators
@ -139,7 +128,9 @@ try:
assert module.BACKUP_REPO_HOST, "The BACKUP_REPO_HOST setting is required."
assert module.BACKUP_HOME_DIR, "The BACKUP_HOME_DIR setting is required."
assert module.BACKUP_BORG_DIR, "The BACKUP_BORG_DIR setting is required."
assert module.BACKUP_AUTHORIZED_KEYS, "The BACKUP_AUTHORIZED_KEYS setting is required."
assert module.BACKUP_AUTHORIZED_KEYS, (
"The BACKUP_AUTHORIZED_KEYS setting is required."
)
except ModuleNotFoundError:
print(f"could not find configuration file {config_module}")
@ -150,3 +141,4 @@ BACKUP_REPO_HOST = module.BACKUP_REPO_HOST
BACKUP_HOME_DIR = module.BACKUP_HOME_DIR
BACKUP_BORG_DIR = module.BACKUP_BORG_DIR
BACKUP_AUTHORIZED_KEYS = module.BACKUP_AUTHORIZED_KEYS
DATABASES = module.DATABASES