From 0e05cda57c1fd688f5b53fdbfc8b425c580cb250 Mon Sep 17 00:00:00 2001 From: Karim Hamidou Date: Sun, 17 Oct 2021 19:06:11 -0700 Subject: [PATCH] Fix import --- config/settings.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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', -- 2.43.0