Skip to content

Commit

Permalink
Adding settings changed to django-environ.
Browse files Browse the repository at this point in the history
  • Loading branch information
gm3dmo committed Sep 20, 2023
1 parent 6ca252a commit d8fa662
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,32 @@

from pathlib import Path

import environ
import os
from dotenv import load_dotenv
dotenv_path = os.path.join(os.path.dirname(__file__), '.env')
load_dotenv(dotenv_path)

env = environ.Env(
# set casting, default value
DEBUG=(bool, False)
)

# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent

# Take environment variables from .env file
environ.Env.read_env(os.path.join(BASE_DIR, '.env'))

# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
# SECRET_KEY = "django-insecure--xsax10=q^o9t9h3)i=4++48=96$+c#(inh#%#zufdw4^kk8s("
SECRET_KEY = str(os.getenv('SECRET_KEY'))

SECRET_KEY = env('SECRET_KEY')

# SECURITY WARNING: don't run with debug turned on in production!
# DEBUG = True
DEBUG = os.environ.get('DEBUG', False)
DEBUG = env('DEBUG')


ALLOWED_HOSTS = []

Expand Down

0 comments on commit d8fa662

Please sign in to comment.