Arreglo de settings.py

develop/cms
Rodrigo_R 2023-08-20 20:53:35 -04:00
parent c11327f7a6
commit d54033b5f5
1 changed files with 11 additions and 3 deletions

View File

@ -12,6 +12,7 @@ https://docs.djangoproject.com/en/3.2/ref/settings/
import os import os
from pathlib import Path from pathlib import Path
from decouple import config
# Build paths inside the project like this: BASE_DIR / 'subdir'. # Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent BASE_DIR = Path(__file__).resolve().parent.parent
@ -27,7 +28,7 @@ SECRET_KEY = 'django-insecure-^ictxnc0j1-^uxvu6233k5sz21!hcyd0=md4$rj^dn9r1eh$@&
DEBUG = True DEBUG = True
SITE_ID = 1 SITE_ID = 1
ALLOWED_HOSTS = [] ALLOWED_HOSTS = ['*']
# Application definition # Application definition
@ -103,8 +104,15 @@ WSGI_APPLICATION = 'myproject.wsgi.application'
DATABASES = { DATABASES = {
'default': { 'default': {
'ENGINE': 'django.db.backends.sqlite3', 'ENGINE': 'django.db.backends.postgresql',
'NAME': BASE_DIR / 'db.sqlite3', 'HOST': config('DBHOST', 'localhost'),
'PORT': config('DBPORT', 5432),
'USER': config('DBUSER','postgres'),
'PASSWORD': config('DBPASS','password'),
'NAME': config('DBNAME','database'),
'OPTIONS': {
'options': '-c search_path=' + config('DBSCHEMA', 'public')
}
} }
} }