created .env file

pull/4/head
Jukoga 2024-07-24 21:33:06 +02:00
parent 02774e6094
commit d54da6f04d
1 changed files with 11 additions and 8 deletions

View File

@ -11,6 +11,7 @@ https://docs.djangoproject.com/en/3.0/ref/settings/
""" """
import os import os
from dotenv import load_dotenv
# Build paths inside the project like this: os.path.join(BASE_DIR, ...) # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
@ -19,13 +20,15 @@ TEMPLATES_DIR = os.path.join(BASE_DIR + '/templates')
# Quick-start development settings - unsuitable for production # Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/ # See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/
load_dotenv()
# SECURITY WARNING: keep the secret key used in production secret! # 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! # 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 # Application definition
@ -79,11 +82,11 @@ WSGI_APPLICATION = 'BH.wsgi.application'
DATABASES = { DATABASES = {
'default': { 'default': {
'ENGINE': 'django.db.backends.mysql', 'ENGINE': 'django.db.backends.mysql',
'NAME': 'BH', 'NAME': os.getenv('DB_NAME'),
'USER': 'jukoga', 'USER': os.getenv('DB_USER'),
'PASSWORD': '69420', 'PASSWORD': os.getenv('DB_PASSWORD'),
'HOST': 'localhost', 'HOST': os.getenv('DB_HOST'),
'PORT': '3306', 'PORT': os.getenv('DB_PORT'),
} }
} }