ocadotechnology / codeforlife-portal-backend

Other
0 stars 15 forks source link

Clean settings #320

Closed faucomte97 closed 3 months ago

faucomte97 commented 4 months ago

This change is Reviewable

SKairinos commented 4 months ago

backend/service/settings.py line 23 at r3 (raw file):

Previously, SKairinos (Stefan Kairinos) wrote…
add the following to CFL package ```py # Database # https://docs.djangoproject.com/en/3.2/ref/settings/#databases def get_databases(base_dir: Path): """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, } } ``` after `from codeforlife.settings import *`, write: ```py DATABASES = get_databases(BASE_DIR) ```

please also do this to omit it from coverage report

def get_databases(base_dir: Path):  # pragma: no cover

we don't need to test this helper