From f74e87b64522aea0d4a21889d25d3bb112c16660 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Tue, 6 Apr 2021 02:39:57 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Allow=20database=20settings=20to?= =?UTF-8?q?=20be=20configured?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sophon/settings.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sophon/settings.py b/sophon/settings.py index 822aa43..836d7e9 100644 --- a/sophon/settings.py +++ b/sophon/settings.py @@ -79,9 +79,10 @@ WSGI_APPLICATION = 'sophon.wsgi.application' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql', - 'HOST': '', # Connect via UNIX socket (does not work on Windows) - 'NAME': 'sophon', - 'USER': 'sophon', # Connect using its own user, isolating sophon from the rest of the server + 'HOST': os.environ.get("DJANGO_DATABASE_HOST", ""), # Connect via UNIX socket (does not work on Windows) + 'NAME': os.environ.get("DJANGO_DATABASE_NAME", "sophon"), + 'USER': os.environ.get("DJANGO_DATABASE_USER", "sophon"), # Connect using its own user, isolating sophon from the rest of the server + 'PASSWORD': os.environ.get("DJANGO_DATABASE_PASSWORD", ""), } }