Files
MAIA/backend/core/config.py
c-d-p 0391cb3505
Some checks failed
Build and Deploy Backend / Run Linters and Tests (push) Failing after 7s
Build and Deploy Backend / Build and Deploy (push) Has been skipped
bandaid
2025-05-01 00:16:56 +02:00

41 lines
1.1 KiB
Python

# core/config.py
from pydantic_settings import BaseSettings
import os
DOTENV_PATH = os.path.join(os.path.dirname(__file__), "../.env.local")
class Settings(BaseSettings):
# Database settings - reads from environment or .env
DB_PORT: int = 5432
DB_NAME: str = "maia"
DB_HOST: str = "localhost"
DB_USER: str = "maia"
DB_PASSWORD: str = "maia"
DB_URL: str = ""
# Redis settings - reads REDIS_URL from environment or .env, also used for Celery.
REDIS_URL: str = "redis://localhost:6379/0"
# JWT settings - reads from environment or .env
JWT_ALGORITHM: str = "HS256"
ACCESS_TOKEN_EXPIRE_MINUTES: int = 30
REFRESH_TOKEN_EXPIRE_DAYS: int = 7
PEPPER: str = "pepper"
JWT_SECRET_KEY: str = "secret"
# Other settings
GOOGLE_API_KEY: str
EXPO_PUSH_API_URL: str = "https://exp.host/--/api/v2/push/send"
class Config:
# Tell pydantic-settings to load variables from a .env file
env_file = DOTENV_PATH
env_file_encoding = "utf-8"
extra = "ignore"
# Create a single instance of the settings
settings = Settings()