Feature: серверная часть, ФИО и результаты теста в БД; правка ответа эскалация 80%
Made-with: Cursor
This commit is contained in:
27
backend/app/config.py
Normal file
27
backend/app/config.py
Normal file
@@ -0,0 +1,27 @@
|
||||
"""Конфигурация приложения."""
|
||||
from pydantic_settings import BaseSettings
|
||||
|
||||
|
||||
class Settings(BaseSettings):
|
||||
"""Настройки из переменных окружения."""
|
||||
|
||||
postgres_host: str = "db"
|
||||
postgres_port: int = 5432
|
||||
postgres_db: str = "lms_it_oms"
|
||||
postgres_user: str = "lms"
|
||||
postgres_password: str = ""
|
||||
content_path: str = "" # Путь к каталогу content (в Docker: /content)
|
||||
|
||||
@property
|
||||
def database_url(self) -> str:
|
||||
return (
|
||||
f"postgresql://{self.postgres_user}:{self.postgres_password}"
|
||||
f"@{self.postgres_host}:{self.postgres_port}/{self.postgres_db}"
|
||||
)
|
||||
|
||||
class Config:
|
||||
env_file = ".env"
|
||||
env_prefix = ""
|
||||
|
||||
|
||||
settings = Settings()
|
||||
Reference in New Issue
Block a user