Made the `SECRET` secret

Made the `SECRET KEY` secret by using .env
pull/6/head
Surya 2024-07-24 22:27:33 +02:00
parent 21624d015b
commit 3eed3e280d
1 changed files with 7 additions and 3 deletions

View File

@ -11,6 +11,7 @@ https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import os
from dotenv import load_dotenv
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
@ -19,13 +20,16 @@ TEMPLATES_DIR = os.path.join(BASE_DIR + '/templates')
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/
# Load the Env
load_dotenv()
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '!2g)+m+_h9fq9%il5+t5#qnj^9502or6$=2!$==v=i2*c#7q*m'
SECRET_KEY = os.getenv('SECRET_KEY')
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
DEBUG = False
ALLOWED_HOSTS = []
ALLOWED_HOSTS = ['localhost', '127.0.0.1']
# Application definition