Spaces:
Runtime error
Runtime error
Download config/settings.py from DesarrolloTT/DataSuitePro: direct link, hf CLI and curl.
- Browser
- Download file 1.64 kB
-
https://huggingface.co/spaces/DesarrolloTT/DataSuitePro/resolve/main/config/settings.py
- Command line
-
hf download hf://spaces/DesarrolloTT/DataSuitePro/config/settings.py
-
curl -L -o settings.py https://huggingface.co/spaces/DesarrolloTT/DataSuitePro/resolve/main/config/settings.py
1.64 kB
| # config/settings.py | |
| import os | |
| from pathlib import Path | |
| from typing import Dict, Any | |
| def check_admin(password_input): | |
| admin_hash = st.secrets["admin"]["hash"] | |
| return bcrypt.checkpw(password_input.encode(), admin_hash.encode()) | |
| class Config: | |
| """Configuraci贸n principal de la aplicaci贸n""" | |
| # Directorios base | |
| BASE_DIR = Path(__file__).parent.parent | |
| EXPORTS_DIR = BASE_DIR / "exports" | |
| TEMPLATES_DIR = BASE_DIR / "templates" | |
| # Formatos soportados | |
| SUPPORTED_INPUT_FORMATS = ['.csv', '.json', '.xlsx', '.xls', '.txt'] | |
| SUPPORTED_OUTPUT_FORMATS = ['.csv', '.json', '.xlsx', '.txt', '.sql', '.db'] | |
| # L铆mites | |
| MAX_FILE_SIZE_MB = 500 | |
| MAX_ROWS_PREVIEW = 1000 | |
| # Configuraci贸n APIs | |
| API_FRAMEWORKS = ['fastapi', 'flask', 'django'] | |
| DATABASE_TYPES = ['sqlite', 'mysql', 'postgresql'] | |
| # Configuraci贸n por defecto | |
| DEFAULT_API_CONFIG = { | |
| 'framework': 'fastapi', | |
| 'authentication': True, | |
| 'pagination': True, | |
| 'documentation': True, | |
| 'cors': True | |
| } | |
| def get_template_path(cls, template_type: str, template_name: str) -> Path: | |
| """Obtiene la ruta de una plantilla""" | |
| return cls.TEMPLATES_DIR / template_type / f"{template_name}.j2" | |
| def get_export_path(cls, export_type: str, project_name: str) -> Path: | |
| """Obtiene la ruta de exportaci贸n""" | |
| export_dir = cls.EXPORTS_DIR / export_type / project_name | |
| export_dir.mkdir(parents=True, exist_ok=True) | |
| return export_dir | |
| # Instancia global de configuraci贸n | |
| config = Config() |