From: Karim Hamidou Date: Mon, 18 Oct 2021 02:06:11 +0000 (-0700) Subject: Fix import X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=0e05cda57c1fd688f5b53fdbfc8b425c580cb250;p=cookie-cutter.git Fix import --- diff --git a/config/settings.py b/config/settings.py index 7f405f9..5b5f49d 100644 --- a/config/settings.py +++ b/config/settings.py @@ -9,8 +9,8 @@ https://docs.djangoproject.com/en/3.2/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.2/ref/settings/ """ +import os import environ -import dj_database_url from pathlib import Path env = environ.Env( @@ -19,6 +19,8 @@ env = environ.Env( # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent +environ.Env.read_env(os.path.join(BASE_DIR, '.env')) + # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/ @@ -85,12 +87,10 @@ WSGI_APPLICATION = 'config.wsgi.application' # Database # https://docs.djangoproject.com/en/3.2/ref/settings/#databases DATABASES = dict() -DATABASES['default'] = dj_database_url.config(conn_max_age=600) - +DATABASES['default'] = env.db() # Password validation # https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators - AUTH_PASSWORD_VALIDATORS = [ { 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',