Skip to content

Commit

Permalink
fix: Add helper get DB function
Browse files Browse the repository at this point in the history
  • Loading branch information
faucomte97 committed Apr 22, 2024
1 parent 7cf61ca commit cff558e
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions codeforlife/settings/django.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
import os
from pathlib import Path

from django.utils.translation import gettext_lazy as _

Expand All @@ -18,6 +19,28 @@

# Application definition

# Database
# https://docs.djangoproject.com/en/3.2/ref/settings/#databases


def get_databases(base_dir: Path): # pragma: no cover
"""Get the databases for the Django project.
Args:
base_dir: The base directory of the Django project.
Returns:
The databases for the django project.
"""
return {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": base_dir / "db.sqlite3",
"ATOMIC_REQUESTS": True,
}
}


MIDDLEWARE = [
"django.contrib.sessions.middleware.SessionMiddleware",
"django.middleware.locale.LocaleMiddleware",
Expand Down

0 comments on commit cff558e

Please sign in to comment.