Files
Data_Visualisation_DMH/backend/app/config.py
T

38 lines
1.0 KiB
Python

import os
from typing import List
from pydantic_settings import BaseSettings
class Settings(BaseSettings):
PROJECT_NAME: str = "DMH Role-Based Data Visualisation Platform"
ENV: str = "development"
DEBUG: bool = True
# Database
DATABASE_URL: str = "sqlite:///./dmh_platform.db"
# Security
SECRET_KEY: str = "dmh-data-vis-secret-key-super-secure-2025"
ALGORITHM: str = "HS256"
ACCESS_TOKEN_EXPIRE_MINUTES: int = 480 # 8 hours
# CORS
ALLOWED_ORIGINS: str = "http://localhost:3000,http://localhost:5173,http://127.0.0.1:5173"
# Initial Super Admin
FIRST_SUPER_ADMIN_EMAIL: str = "admin@dmh.org"
FIRST_SUPER_ADMIN_USERNAME: str = "admin"
FIRST_SUPER_ADMIN_PASSWORD: str = "Admin@123456"
@property
def cors_origins(self) -> List[str]:
return [origin.strip() for origin in self.ALLOWED_ORIGINS.split(",") if origin.strip()]
class Config:
env_file = ".env"
env_file_encoding = "utf-8"
extra = "ignore"
settings = Settings()