From b9cc50a89c3c16822934626d979c0623f3c29a7d Mon Sep 17 00:00:00 2001 From: Aaron Riedener Date: Sun, 31 Mar 2024 21:47:45 +0200 Subject: [PATCH] [Issue #347] updated version and production settings --- koalixcrm/version.py | 2 +- .../production_docker_postgres_settings.py | 25 +++++++++++-------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/koalixcrm/version.py b/koalixcrm/version.py index 0284af96..87fda557 100644 --- a/koalixcrm/version.py +++ b/koalixcrm/version.py @@ -1,3 +1,3 @@ # -*- coding: utf-8 -*- -KOALIXCRM_VERSION = "1.13.dev11" \ No newline at end of file +KOALIXCRM_VERSION = "1.13.0" \ No newline at end of file diff --git a/projectsettings/settings/production_docker_postgres_settings.py b/projectsettings/settings/production_docker_postgres_settings.py index f03de9fb..6c00a291 100644 --- a/projectsettings/settings/production_docker_postgres_settings.py +++ b/projectsettings/settings/production_docker_postgres_settings.py @@ -2,21 +2,24 @@ Django settings for koalixcrm project when used in productive environment. """ -ALLOWED_HOSTS = ['*'] +from .base_settings import * -# SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = 'modify_during_deployment' +SECRET_KEY = os.environ.get("SECRET_KEY") -# SECURITY WARNING: don't run with debug turned on in production! -DEBUG = False +DEBUG = bool(os.environ.get("DEBUG", default=0)) + +# 'DJANGO_ALLOWED_HOSTS' should be a single string of hosts with a space between each. +# For example: 'DJANGO_ALLOWED_HOSTS=localhost 127.0.0.1 [::1]' +ALLOWED_HOSTS = os.environ.get("DJANGO_ALLOWED_HOSTS").split(" ") DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.postgresql', - 'NAME': 'postgres', - 'USER': 'postgres', - 'HOST': 'db', - 'PORT': 5432, + "default": { + "ENGINE": os.environ.get("SQL_ENGINE", "django.db.backends.postgresql"), + "NAME": os.environ.get("SQL_DATABASE", BASE_DIR / "postgres"), + "USER": os.environ.get("SQL_USER", "postgres"), + "PASSWORD": os.environ.get("SQL_PASSWORD", "password"), + "HOST": os.environ.get("SQL_HOST", "localhost"), + "PORT": os.environ.get("SQL_PORT", "5432"), } }