From 6520240a007a7c44912c3e7aadb039fdae413265 Mon Sep 17 00:00:00 2001 From: stdpi Date: Sat, 25 May 2024 23:20:03 +0700 Subject: [PATCH] fix(cfg): idiot's config construction --- fuhoblog/settings/production.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fuhoblog/settings/production.py b/fuhoblog/settings/production.py index 795526c..f35303b 100644 --- a/fuhoblog/settings/production.py +++ b/fuhoblog/settings/production.py @@ -19,11 +19,11 @@ DATABASES |= { 'default': { 'ENGINE': 'django.db.backends.mysql', - 'NAME': os.environ['MYSQL_DATABASE'], - 'USER': os.environ['MYSQL_PASSWORD'], - 'PASSWORD': os.environ['MYSQL_PASSWORD'], - 'HOST': os.environ['MYSQL_HOST'], - 'PORT': os.environ['MYSQL_PORT'], + 'NAME': DATABASE_ENVIRON.path or 'wagtail', + 'USER': DATABASE_ENVIRON.username or 'root', + 'PASSWORD': DATABASE_ENVIRON.password or '', + 'HOST': DATABASE_ENVIRON.hostname or 'localhost', + 'PORT': int(DATABASE_ENVIRON.port) or 3306, }, } else: