From e8de1476577f350a409ec5e082800d72967ee82e Mon Sep 17 00:00:00 2001 From: Jean-Louis Jouannic Date: Wed, 8 Jun 2022 21:43:52 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20adds=20config=20file=20for=20Cle?= =?UTF-8?q?ver=20Cloud=20deployment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- babybuddy/settings/.gitignore | 1 + babybuddy/settings/clever-cloud.py | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 babybuddy/settings/clever-cloud.py diff --git a/babybuddy/settings/.gitignore b/babybuddy/settings/.gitignore index 8ab19179..3e298eed 100644 --- a/babybuddy/settings/.gitignore +++ b/babybuddy/settings/.gitignore @@ -9,3 +9,4 @@ !railway.py !render.py !test.py +!clever-cloud.py diff --git a/babybuddy/settings/clever-cloud.py b/babybuddy/settings/clever-cloud.py new file mode 100644 index 00000000..e83281d9 --- /dev/null +++ b/babybuddy/settings/clever-cloud.py @@ -0,0 +1,17 @@ +from .base import * +import os + +if os.getenv("POSTGRESQL_ADDON_HOST"): + config["ENGINE"] = "django.db.backends.postgresql" + config["HOST"] = os.getenv("POSTGRESQL_ADDON_HOST") + config["PORT"] = os.getenv("POSTGRESQL_ADDON_PORT") + config["NAME"] = os.getenv("POSTGRESQL_ADDON_DB") + config["USER"] = os.getenv("POSTGRESQL_ADDON_USER") + config["PASSWORD"] = os.getenv("POSTGRESQL_ADDON_PASSWORD") + +if os.getenv("CELLAR_ADDON_HOST"): + BABY_BUDDY["ALLOW_UPLOADS"] = True + AWS_S3_ENDPOINT_URL = "https://{}".format( + os.environ.get("CELLAR_ADDON_HOST")) + AWS_ACCESS_KEY_ID = os.environ.get("CELLAR_ADDON_KEY_ID") + AWS_SECRET_ACCESS_KEY = os.environ.get("CELLAR_ADDON_KEY_SECRET")