amo-server/utils/config.py
Maxim Snesarev 33d6bb7ebd Refactor AMO CRM Data Collection Service to use PostgreSQL
- Updated database configuration to switch from SQLite to PostgreSQL, including changes to alembic.ini, Docker Compose, and environment settings.
- Refactored application code to utilize PostgreSQL database adapters, ensuring compatibility with the new database structure.
- Enhanced API routes and data handling to support the new database, including adjustments in data models and query logic.
- Introduced new job processing mechanisms for full synchronization of AMO CRM entities, leveraging FastStream for background tasks.
- Improved logging and error handling across the application to facilitate better monitoring and debugging.
- Removed obsolete SQLite adapter files and migrations, streamlining the project structure for PostgreSQL integration.
2025-11-05 00:38:37 +03:00

36 lines
1009 B
Python

from pydantic_settings import BaseSettings
# Removed unused import
class Settings(BaseSettings):
# Database
DATABASE_URL: str = "postgresql://amo_user:amo_password@localhost:5432/amo_data"
# AMO CRM API
AMO_CRM_DOMAIN: str = "wecheap.amocrm.ru"
AMO_CRM_ACCESS_TOKEN: str = "" # Make it optional with default empty string
# Google Sheets API
GOOGLE_SERVICE_ACCOUNT_FILE: str = "" # Make it optional
GOOGLE_SCOPES: str = "https://www.googleapis.com/auth/spreadsheets"
# Redis (for FastStream message broker)
REDIS_URL: str = "redis://localhost:6379/0"
# RabbitMQ (for FastStream message broker - alternative to Redis)
RABBITMQ_URL: str = "amqp://admin:admin123@localhost:5672/"
# API Settings
API_V1_STR: str = "/api/v1"
API_BASE_URL: str = "http://localhost:8000" # Base URL for internal API calls
# Logging
LOG_LEVEL: str = "INFO"
class Config:
env_file = ".env"
case_sensitive = True
settings = Settings()