From ac6eade4129b163696a40e0452f0a85ca20dacb1 Mon Sep 17 00:00:00 2001 From: jedi Date: Sat, 18 Nov 2023 17:46:54 +0100 Subject: [PATCH] read database settings from .env file --- core/core/settings.py | 8 ++++++-- core/requirements.txt | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/core/core/settings.py b/core/core/settings.py index 3712a08..5417c43 100644 --- a/core/core/settings.py +++ b/core/core/settings.py @@ -101,8 +101,12 @@ WSGI_APPLICATION = 'core.wsgi.application' DATABASES = { 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': BASE_DIR / 'db.sqlite3', + 'ENGINE': 'django.db.backends.mysql', + 'HOST': os.getenv('DB_HOST', 'localhost'), + 'PORT': os.getenv('DB_PORT', '3306'), + 'NAME': os.getenv('DB_NAME', 'system3'), + 'USER': os.getenv('DB_USER', 'system3'), + 'PASSWORD': os.getenv('DB_PASSWORD', 'system3'), } } diff --git a/core/requirements.txt b/core/requirements.txt index e02d03d..0f42b18 100644 --- a/core/requirements.txt +++ b/core/requirements.txt @@ -18,6 +18,7 @@ itypes==1.2.0 Jinja2==3.1.2 MarkupSafe==2.1.3 msgpack-python==0.5.6 +mysqlclient openapi-codec==1.3.2 packaging==23.2 Pillow==10.1.0