Add SSLMODE to database connection properties

Defaulting to SSLMODE=prefer, optional override using environment variable: DB_SSLMODE
This commit is contained in:
Stefan de Kooter 2019-11-06 10:26:29 +01:00 committed by GitHub
parent 8d71d2f973
commit 6568dff8e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -37,6 +37,8 @@ DATABASE = {
# PostgreSQL password
'HOST': os.environ.get('DB_HOST', 'localhost'), # Database server
'PORT': os.environ.get('DB_PORT', ''), # Database port (leave blank for default)
'OPTIONS': {'sslmode': os.environ.get('DB_SSLMODE', 'prefer')},
# Database connection SSLMODE
}
# This key is used for secure generation of random numbers and strings. It must never be exposed outside of this file.