From 6126901bf6fee42ebf28f1e054e93ffdb73f10c5 Mon Sep 17 00:00:00 2001 From: Patrick Canterino Date: Sun, 23 Jan 2022 17:53:38 +0100 Subject: [PATCH 1/1] Switched from SQLite3 to MariaDB / MySQL --- pcdenotes/settings.py | 8 ++++++-- requirements.txt | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pcdenotes/settings.py b/pcdenotes/settings.py index fdd29e4..db9476f 100644 --- a/pcdenotes/settings.py +++ b/pcdenotes/settings.py @@ -82,8 +82,12 @@ WSGI_APPLICATION = 'pcdenotes.wsgi.application' DATABASES = { 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': BASE_DIR / 'db.sqlite3', + 'ENGINE': 'django.db.backends.mysql', + 'NAME': str(os.getenv('PCDENOTES_DB_NAME')), + 'HOST': str(os.getenv('PCDENOTES_DB_HOST')), + 'PORT': int(os.getenv('PCDENOTES_DB_PORT')), + 'USER': str(os.getenv('PCDENOTES_DB_USER')), + 'PASSWORD': str(os.getenv('PCDENOTES_DB_PASSWORD')) } } diff --git a/requirements.txt b/requirements.txt index ff18f3b..e7359d4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,6 +4,7 @@ Django==3.2.11 django-markdownify==0.9.0 importlib-metadata==4.8.3 Markdown==3.3.6 +mysqlclient==2.1.0 packaging==21.3 pkg-resources==0.0.0 pyparsing==3.0.6 -- 2.34.1