mirror of
https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git
synced 2025-08-14 00:25:46 +02:00
30 lines
741 B
Python
30 lines
741 B
Python
"""Application configuration"""
|
|
from functools import lru_cache
|
|
from pydantic_settings import BaseSettings
|
|
|
|
class Settings(BaseSettings):
|
|
"""Application settings"""
|
|
PROJECT_NAME: str = "Employee Request System"
|
|
|
|
# Database
|
|
DATABASE_URL: str = "postgresql://postgres:postgres@localhost:5432/employee_requests"
|
|
|
|
# JWT
|
|
SECRET_KEY: str = "your-secret-key"
|
|
ALGORITHM: str = "HS256"
|
|
ACCESS_TOKEN_EXPIRE_MINUTES: int = 30
|
|
|
|
# Redis
|
|
REDIS_HOST: str = "localhost"
|
|
REDIS_PORT: int = 6379
|
|
|
|
class Config:
|
|
"""Pydantic config"""
|
|
case_sensitive = True
|
|
|
|
@lru_cache()
|
|
def get_settings() -> Settings:
|
|
"""Get cached settings"""
|
|
return Settings()
|
|
|
|
settings = get_settings() |