commit
This commit is contained in:
41
backend/app/core/config.py
Normal file
41
backend/app/core/config.py
Normal file
@@ -0,0 +1,41 @@
|
||||
|
||||
from typing import List, Optional, Union
|
||||
from pydantic import AnyHttpUrl, PostgresDsn, computed_field
|
||||
from pydantic_settings import BaseSettings, SettingsConfigDict
|
||||
|
||||
class Settings(BaseSettings):
|
||||
PROJECT_NAME: str = "Auteur AI"
|
||||
API_V1_STR: str = "/api/v1"
|
||||
|
||||
# CORS
|
||||
BACKEND_CORS_ORIGINS: List[AnyHttpUrl] = []
|
||||
|
||||
# Database
|
||||
POSTGRES_USER: str = "postgres"
|
||||
POSTGRES_PASSWORD: str = "postgres"
|
||||
POSTGRES_SERVER: str = "db"
|
||||
POSTGRES_PORT: int = 5432
|
||||
POSTGRES_DB: str = "auteur"
|
||||
|
||||
@computed_field
|
||||
@property
|
||||
def DATABASE_URL(self) -> str:
|
||||
return f"postgresql+asyncpg://{self.POSTGRES_USER}:{self.POSTGRES_PASSWORD}@{self.POSTGRES_SERVER}:{self.POSTGRES_PORT}/{self.POSTGRES_DB}"
|
||||
|
||||
# MinIO
|
||||
MINIO_ENDPOINT: str = "minio:9000"
|
||||
MINIO_ACCESS_KEY: str = "minioadmin"
|
||||
MINIO_SECRET_KEY: str = "minioadmin"
|
||||
MINIO_BUCKET: str = "auteur-assets"
|
||||
|
||||
# Redis
|
||||
REDIS_URL: str = "redis://redis:6379/0"
|
||||
|
||||
# OpenAI
|
||||
OPENAI_API_BASE: str
|
||||
OPENAI_API_KEY: str
|
||||
OPENAI_MODEL: str = "gemini-2.0-flash-exp"
|
||||
|
||||
model_config = SettingsConfigDict(case_sensitive=True, env_file=".env", extra="ignore")
|
||||
|
||||
settings = Settings()
|
||||
Reference in New Issue
Block a user