diff --git a/config/settings.py b/config/settings.py index 717b95b..e561c85 100644 --- a/config/settings.py +++ b/config/settings.py @@ -10,20 +10,23 @@ For the full list of settings and their values, see https://docs.djangoproject.com/en/5.1/ref/settings/ """ +import environ +import os from pathlib import Path -# Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent +env = environ.Env(DEBUG=(bool, False)) +environ.Env.read_env(BASE_DIR / ".env") # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/5.1/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = "django-insecure-x=%#_wxu0h=d*m#seui9+mjh3vu7of8+4+gpwj@556$un0r1%$" +SECRET_KEY = env("SECRET_KEY") # SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True +DEBUG = env("DEBUG") ALLOWED_HOSTS = [] @@ -74,10 +77,7 @@ WSGI_APPLICATION = "config.wsgi.application" # https://docs.djangoproject.com/en/5.1/ref/settings/#databases DATABASES = { - "default": { - "ENGINE": "django.db.backends.sqlite3", - "NAME": BASE_DIR / "db.sqlite3", - } + "default": env.db(), }