iteracion 2

This commit is contained in:
Nachou-u
2026-09-07 18:44:32 -03:00
parent a103a47ae6
commit 09a3f6fb37
93 changed files with 7394 additions and 349 deletions
+27 -10
View File
@@ -11,21 +11,28 @@ https://docs.djangoproject.com/en/6.1/ref/settings/
"""
from pathlib import Path
import environ
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
# Inicializar environ
env = environ.Env(
DEBUG=(bool, False)
)
# Leer .env si existe
environ.Env.read_env(BASE_DIR / '.env')
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/6.1/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'django-insecure-r9n6j1_h%@uqoz0bjz^mq=t72o0t*j@84jpl%_i4^qu%&+**u7'
SECRET_KEY = env('SECRET_KEY', default='django-insecure-fallback-key')
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
DEBUG = env('DEBUG')
ALLOWED_HOSTS = []
ALLOWED_HOSTS = env.list('ALLOWED_HOSTS', default=['*'])
# Application definition
@@ -41,6 +48,9 @@ INSTALLED_APPS = [
'django.contrib.humanize',
'channels',
'expenses',
'payroll',
'procurement',
'talent',
]
MIDDLEWARE = [
@@ -74,10 +84,12 @@ WSGI_APPLICATION = 'config.wsgi.application'
ASGI_APPLICATION = 'config.asgi.application'
# Configuracion de WebSockets (Channels)
# Para produccion (VPS), cambiar a 'channels_redis.core.RedisChannelLayer'
CHANNEL_LAYERS = {
"default": {
"BACKEND": "channels.layers.InMemoryChannelLayer"
"BACKEND": "channels_redis.core.RedisChannelLayer",
"CONFIG": {
"hosts": [env('REDIS_URL', default='redis://localhost:6379/0')],
},
}
}
@@ -86,10 +98,7 @@ CHANNEL_LAYERS = {
# https://docs.djangoproject.com/en/6.1/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
'default': env.db('DATABASE_URL', default=f"sqlite:///{BASE_DIR / 'db.sqlite3'}")
}
@@ -117,7 +126,7 @@ AUTH_PASSWORD_VALIDATORS = [
LANGUAGE_CODE = 'es-cl'
TIME_ZONE = 'UTC'
TIME_ZONE = 'America/Santiago'
USE_I18N = True
@@ -149,3 +158,11 @@ MAILERS = {
'BACKEND': 'django.core.mail.backends.console.EmailBackend',
},
}
# Celery Configuration
CELERY_BROKER_URL = env('REDIS_URL', default='redis://localhost:6379/0')
CELERY_RESULT_BACKEND = env('REDIS_URL', default='redis://localhost:6379/0')
CELERY_ACCEPT_CONTENT = ['json']
CELERY_TASK_SERIALIZER = 'json'
CELERY_RESULT_SERIALIZER = 'json'
CELERY_TIMEZONE = TIME_ZONE