Files
Consultoría AS f458f809ca fix: Add scipy dependency and fix config for Docker deployment
- Add scipy==1.11.4 for A/B testing statistical analysis
- Add SMTP config fields and extra="ignore" to Settings
- Remove obsolete 'version' attribute from docker-compose.yml

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 03:29:38 +00:00

80 lines
2.4 KiB
Python

"""
Configuración central del sistema.
Carga variables de entorno y define settings globales.
"""
from pydantic_settings import BaseSettings
from typing import Optional
class Settings(BaseSettings):
"""Configuración de la aplicación."""
# Aplicación
APP_NAME: str = "social-media-automation"
APP_ENV: str = "development"
DEBUG: bool = True
SECRET_KEY: str = "change-this-in-production"
# Base de datos
DATABASE_URL: str = "postgresql://social_user:social_pass@localhost:5432/social_automation"
# Redis
REDIS_URL: str = "redis://localhost:6379/0"
# DeepSeek API
DEEPSEEK_API_KEY: Optional[str] = None
DEEPSEEK_BASE_URL: str = "https://api.deepseek.com/v1"
# X (Twitter) API
X_API_KEY: Optional[str] = None
X_API_SECRET: Optional[str] = None
X_ACCESS_TOKEN: Optional[str] = None
X_ACCESS_TOKEN_SECRET: Optional[str] = None
X_BEARER_TOKEN: Optional[str] = None
# Meta API (Facebook, Instagram, Threads)
META_APP_ID: Optional[str] = None
META_APP_SECRET: Optional[str] = None
META_ACCESS_TOKEN: Optional[str] = None
FACEBOOK_PAGE_ID: Optional[str] = None
INSTAGRAM_ACCOUNT_ID: Optional[str] = None
THREADS_USER_ID: Optional[str] = None
# Información del negocio
BUSINESS_NAME: str = "Consultoría AS"
BUSINESS_LOCATION: str = "Tijuana, México"
BUSINESS_WEBSITE: str = "https://consultoria-as.com"
CONTENT_TONE: str = "profesional pero cercano, educativo, orientado a soluciones"
# Notificaciones
TELEGRAM_BOT_TOKEN: Optional[str] = None
TELEGRAM_CHAT_ID: Optional[str] = None
# Analytics
ANALYTICS_FETCH_INTERVAL: int = 15 # minutes
TELEGRAM_REPORT_ENABLED: bool = True
TELEGRAM_REPORT_DAY: int = 6 # Sunday (0=Monday, 6=Sunday)
# Odoo Integration
ODOO_URL: Optional[str] = None # e.g., "https://mycompany.odoo.com"
ODOO_DB: Optional[str] = None
ODOO_USERNAME: Optional[str] = None
ODOO_PASSWORD: Optional[str] = None # API key or password
ODOO_SYNC_ENABLED: bool = False
# SMTP (Optional - for email notifications)
SMTP_HOST: Optional[str] = None
SMTP_PORT: int = 587
SMTP_USER: Optional[str] = None
SMTP_PASSWORD: Optional[str] = None
class Config:
env_file = ".env"
case_sensitive = True
extra = "ignore" # Ignore extra env vars not defined here
# Instancia global de configuración
settings = Settings()