From 8a0a7558894afce8d25b7f0dc16775e899b72a94 Mon Sep 17 00:00:00 2001 From: Michael Manfre Date: Tue, 8 Nov 2022 23:05:51 -0500 Subject: Add basic docker support --- takahe/settings.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'takahe') diff --git a/takahe/settings.py b/takahe/settings.py index fea5244..62065d2 100644 --- a/takahe/settings.py +++ b/takahe/settings.py @@ -1,10 +1,11 @@ +import os from pathlib import Path # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent # SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = "insecure_secret" +SECRET_KEY = os.environ.get("SECRET_KEY", "insecure_secret") # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True @@ -64,8 +65,10 @@ WSGI_APPLICATION = "takahe.wsgi.application" DATABASES = { "default": { "ENGINE": "django.db.backends.postgresql_psycopg2", - "NAME": "takahe", - "USER": "postgres", + "HOST": os.environ.get("POSTGRES_HOST", "localhost"), + "NAME": os.environ.get("POSTGRES_DB", "takahe"), + "USER": os.environ.get("POSTGRES_USER", "postgres"), + "PASSWORD": os.environ.get("POSTGRES_PASSWORD"), } } -- cgit v1.2.3