Add DB options support (#745)

* Update base.py

allow postgres SSL

* Update base.py

* Update database.md

documentation

* Update database.md

* Update database.md

* Update database.md

Docs specified that postgres was the default variable, but settings/base.py:100-115 uses SQLite as default.

* Adjust documentation language

---------

Co-authored-by: Christopher Charbonneau Wells <10456740+cdubz@users.noreply.github.com>
This commit is contained in:
mmomjian 2024-01-06 06:39:18 -05:00 committed by GitHub
parent bdeb14968a
commit 9b603a9e84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 7 deletions

View File

@ -111,6 +111,8 @@ if os.getenv("DB_HOST"):
config["HOST"] = os.getenv("DB_HOST") config["HOST"] = os.getenv("DB_HOST")
if os.getenv("DB_PORT"): if os.getenv("DB_PORT"):
config["PORT"] = os.getenv("DB_PORT") config["PORT"] = os.getenv("DB_PORT")
if os.getenv("DB_OPTIONS"):
config["OPTIONS"] = os.getenv("DB_OPTIONS")
DATABASES = {"default": config} DATABASES = {"default": config}

View File

@ -2,7 +2,7 @@
## `DB_ENGINE` ## `DB_ENGINE`
*Default:* `django.db.backends.postgresql` *Default:* `django.db.backends.sqlite3`
The database engine utilized for the deployment. The database engine utilized for the deployment.
@ -10,31 +10,37 @@ See also [Django's documentation on the ENGINE setting](https://docs.djangoproje
## `DB_HOST` ## `DB_HOST`
*Default:* `db` *Default:* unset
The name of the database host for the deployment. The name of the database host for the deployment.
## `DB_NAME` ## `DB_NAME`
*Default:* `postgres` *Default:* `BASE_DIR/data/db.sqlite3`
The name of the database table utilized for the deployment. The name of the database table utilized for the deployment.
## `DB_PASSWORD` ## `DB_PASSWORD`
*Default:* `None` *Default:* unset
The password for the database user for the deployment. In the default example, The password for the database user for the deployment. In the default example,
this is the root PostgreSQL password. this is the root PostgreSQL password.
## `DB_PORT` ## `DB_PORT`
*Default:* `5432` *Default:* unset
The listening port for the database. The default port is 5432 for PostgreSQL. The listening port for the database. The default port for PostgreSQL is 5432.
## `DB_USER` ## `DB_USER`
*Default:* `postgres` *Default:* unset
The database username utilized for the deployment. The database username utilized for the deployment.
## `DB_OPTIONS`
*Default:* unset
Additional options to pass to the database library. See the [Django Databases documentation](https://docs.djangoproject.com/en/5.0/ref/databases/) for examples. To enforce an SSL connection to the database, use `{'sslmode': 'require'}`.