added specific settings for development and production
This commit is contained in:
1
back_latienda/settings/__init__.py
Normal file
1
back_latienda/settings/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from back_latienda.settings.development import *
|
||||
@@ -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
|
||||
21
back_latienda/settings/development.py
Normal file
21
back_latienda/settings/development.py
Normal 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'),
|
||||
},
|
||||
}
|
||||
14
back_latienda/settings/production.py
Normal file
14
back_latienda/settings/production.py
Normal 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 = {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user