39 lines
815 B
Python
39 lines
815 B
Python
from pydantic_settings import BaseSettings
|
|
from functools import lru_cache
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
# Database
|
|
database_url: str = "sqlite:////data/db/plants.sqlite"
|
|
|
|
# Redis
|
|
redis_url: str = "redis://redis:6379/0"
|
|
|
|
# Storage paths
|
|
images_path: str = "/data/images"
|
|
exports_path: str = "/data/exports"
|
|
imports_path: str = "/data/imports"
|
|
logs_path: str = "/data/logs"
|
|
|
|
# API Keys
|
|
flickr_api_key: str = ""
|
|
flickr_api_secret: str = ""
|
|
inaturalist_app_id: str = ""
|
|
inaturalist_app_secret: str = ""
|
|
trefle_api_key: str = ""
|
|
|
|
# Logging
|
|
log_level: str = "INFO"
|
|
|
|
# Celery
|
|
celery_concurrency: int = 4
|
|
|
|
class Config:
|
|
env_file = ".env"
|
|
extra = "ignore"
|
|
|
|
|
|
@lru_cache()
|
|
def get_settings() -> Settings:
|
|
return Settings()
|