X-Git-Url: https://git.p6c8.net/pcdenotes.git/blobdiff_plain/16158647286ae7497203e084789688c613698d68..80a429d30dd44b0274bf92486fa7639441116ced:/pcdenotes/settings.py?ds=inline diff --git a/pcdenotes/settings.py b/pcdenotes/settings.py index fdd29e4..5e82661 100644 --- a/pcdenotes/settings.py +++ b/pcdenotes/settings.py @@ -13,13 +13,14 @@ https://docs.djangoproject.com/en/3.2/ref/settings/ from pathlib import Path from dotenv import load_dotenv, find_dotenv -load_dotenv(find_dotenv()) import os # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent +# Load .env file +load_dotenv(BASE_DIR / '.env') # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/ @@ -82,8 +83,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')) } }