| """ |
| Development environment configuration for BackgroundFX Pro. |
| |
| Optimized for local development with debugging and hot-reload enabled. |
| """ |
|
|
| from dataclasses import dataclass, field |
| from pathlib import Path |
| from typing import List |
|
|
| from ..settings import Settings |
|
|
|
|
| @dataclass |
| class DevelopmentSettings(Settings): |
| """ |
| Development-specific configuration with relaxed security and debug features. |
| """ |
| |
| |
| environment: str = "development" |
| debug: bool = True |
| |
| |
| host: str = "127.0.0.1" |
| port: int = 8000 |
| workers: int = 1 |
| reload: bool = True |
| |
| |
| secret_key: str = "dev-secret-key-not-for-production" |
| cors_origins: List[str] = field(default_factory=lambda: ["*"]) |
| |
| |
| api_docs_enabled: bool = True |
| |
| |
| database_url: str = "postgresql://postgres:postgres@localhost:5432/backgroundfx_dev" |
| database_echo: bool = True |
| database_pool_size: int = 5 |
| database_max_overflow: int = 10 |
| |
| |
| mongodb_url: str = "mongodb://localhost:27017/backgroundfx_dev" |
| |
| |
| redis_url: str = "redis://localhost:6379/0" |
| redis_max_connections: int = 10 |
| |
| |
| storage_backend: str = "local" |
| local_storage_path: Path = field(default_factory=lambda: Path("./storage/dev")) |
| |
| |
| max_image_size: int = 20 * 1024 * 1024 |
| max_video_size: int = 100 * 1024 * 1024 |
| max_batch_size: int = 10 |
| processing_timeout: int = 120 |
| enable_gpu: bool = False |
| gpu_memory_fraction: float = 0.5 |
| |
| |
| models_dir: Path = field(default_factory=lambda: Path("./models")) |
| model_cache_dir: Path = field(default_factory=lambda: Path("./cache/models")) |
| |
| |
| celery_broker_url: str = "redis://localhost:6379/1" |
| celery_result_backend: str = "redis://localhost:6379/2" |
| celery_worker_concurrency: int = 2 |
| celery_task_time_limit: int = 300 |
| |
| |
| jwt_secret_key: str = "dev-jwt-secret-key" |
| jwt_expiration_delta: int = 86400 |
| |
| |
| rate_limit_enabled: bool = False |
| rate_limit_requests: int = 10000 |
| rate_limit_window: int = 60 |
| |
| |
| sentry_dsn: str = "" |
| prometheus_enabled: bool = False |
| |
| |
| log_level: str = "DEBUG" |
| log_file: str = "./logs/dev.log" |
| |
| |
| cache_ttl: int = 60 |
| cache_max_entries: int = 100 |
| |
| |
| cdn_enabled: bool = False |
| cdn_base_url: str = "http://localhost:8000/static" |
| |
| |
| smtp_host: str = "localhost" |
| smtp_port: int = 1025 |
| smtp_use_tls: bool = False |
| email_from: str = "dev@localhost" |
| |
| |
| webhook_timeout: int = 10 |
| webhook_max_retries: int = 1 |
| webhook_retry_delay: int = 1 |
| |
| |
| enable_video_processing: bool = True |
| enable_batch_processing: bool = True |
| enable_ai_backgrounds: bool = True |
| enable_webhooks: bool = True |
| |
| |
| auto_create_test_data: bool = True |
| mock_external_services: bool = True |
| enable_profiling: bool = True |
| enable_debug_toolbar: bool = True |
| |
| def __post_init__(self): |
| """Additional development-specific initialization.""" |
| super().__post_init__() |
| |
| |
| for dir_path in [ |
| self.local_storage_path, |
| self.models_dir, |
| self.model_cache_dir, |
| self.log_dir, |
| self.temp_dir |
| ]: |
| dir_path.mkdir(parents=True, exist_ok=True) |
| |
| |
| test_data_dir = Path("./test_data") |
| test_data_dir.mkdir(exist_ok=True) |