Coverage for /Users/davegaeddert/Developer/dropseed/plain/plain-models/plain/models/default_settings.py: 88%

1 from os import environ

2

3 from . import database_url

4

5# Make DATABASES a required setting

6 DATABASES: dict

7

8# Automatically configure DATABASES if a DATABASE_URL was given in the environment

9 if "DATABASE_URL" in environ:

10 DATABASES = {

11 "default": database_url.parse(

12 environ["DATABASE_URL"],

13 # Enable persistent connections by default

14 conn_max_age=int(environ.get("DATABASE_CONN_MAX_AGE", 600)),

15 conn_health_checks=environ.get(

16 "DATABASE_CONN_HEALTH_CHECKS", "true"

17 ).lower()

18 in [

19 "true",

20 "1",

21 ],

22 )

23 }

24

25# Classes used to implement DB routing behavior.

26 DATABASE_ROUTERS = []

27

28# The tablespaces to use for each model when not specified otherwise.

29 DEFAULT_TABLESPACE = ""

30 DEFAULT_INDEX_TABLESPACE = ""