added specific settings for development and production

This commit is contained in:
Sam
2021-01-21 10:42:42 +00:00
parent adb1371599
commit 5c4c004faf
4 changed files with 37 additions and 19 deletions

View File

@@ -0,0 +1 @@
from back_latienda.settings.development import *

View File

@@ -19,7 +19,7 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Get variables from .env
dotenv.read_dotenv(
dotenv=os.path.join(BASE_DIR, '.env'),
dotenv=os.path.join(BASE_DIR, '../.env'),
override=True
)
@@ -29,11 +29,6 @@ dotenv.read_dotenv(
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'td*#7t-(1e9^(g0cod*hs**dp(%zvg@=$cug_-dtzcj#i2mrz@'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
@@ -84,20 +79,7 @@ TEMPLATES = [
WSGI_APPLICATION = 'back_latienda.wsgi.application'
# Database
# https://docs.djangoproject.com/en/2.2/ref/settings/#databases
# Databases configuration
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': os.getenv('DB_NAME'),
'USER': os.getenv('DB_USER'),
'PASSWORD': os.getenv('DB_PASSWORD'),
'HOST': os.getenv('DB_HOST', 'localhost'),
'PORT': os.getenv('DB_PORT', '5432'),
},
}
# Password validation

View File

@@ -0,0 +1,21 @@
from back_latienda.settings.base import *
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = []
# Database
# https://docs.djangoproject.com/en/2.2/ref/settings/#databases
# Databases configuration
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': os.getenv('DB_NAME'),
'USER': os.getenv('DB_USER'),
'PASSWORD': os.getenv('DB_PASSWORD'),
'HOST': os.getenv('DB_HOST'),
'PORT': os.getenv('DB_PORT'),
},
}

View File

@@ -0,0 +1,14 @@
from back_latienda.settings.base import *
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False
ALLOWED_HOSTS = ['127.0.0.1:8000', 'localhost']
# Database
# https://docs.djangoproject.com/en/2.2/ref/settings/#databases
# Databases configuration
DATABASES = {
}