]> khamidou — GitHub mirrors - cookie-cutter.git/commitdiff
Fix import main
authorKarim Hamidou <khamidou@gmail.com>
Mon, 18 Oct 2021 02:06:11 +0000 (19:06 -0700)
committerKarim Hamidou <khamidou@gmail.com>
Mon, 18 Oct 2021 02:06:11 +0000 (19:06 -0700)
config/settings.py

index 7f405f99705a8165d4a99d085077ad9ed41ada6d..5b5f49d2d11012de2584d471e63c82aa140dd306 100644 (file)
@@ -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/
 """
 For the full list of settings and their values, see
 https://docs.djangoproject.com/en/3.2/ref/settings/
 """
+import os
 import environ
 import environ
-import dj_database_url
 from pathlib import Path
 
 env = environ.Env(
 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
 
 # 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/
 
 # 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()
 # 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
 
 # Password validation
 # https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators
-
 AUTH_PASSWORD_VALIDATORS = [
     {
         'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
 AUTH_PASSWORD_VALIDATORS = [
     {
         'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',