set DB on sslmode=require on prod

This commit is contained in:
Aarni Halinen
2021-05-16 18:42:58 +03:00
parent dac0fa1953
commit fb3328cb23
2 changed files with 4 additions and 0 deletions
+3
View File
@@ -46,6 +46,8 @@ TELEGRAM_BOT_TOKEN = os.getenv('TG_BOT_TOKEN', '<tg token>')
# Database settings
# Only uncomment if default settings in base.py are not ok
DB_OPTIONS = {'sslmode': 'require'} if os.getenv('DB_SSL', False) == 'True' else {}
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
@@ -54,5 +56,6 @@ DATABASES = {
'PASSWORD': os.getenv('DB_PASSWD', 'postgres'),
'HOST': os.getenv('DB_HOST', 'localhost'),
'PORT': os.getenv('DB_PORT', 5432),
'OPTIONS': DB_OPTIONS,
}
}