This repository has been archived on 2026-07-21. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
crisleo94 6b4c0c43f8 feat: uv config other feats
- add uv configuration for the backend
- update frontend to make auth work
- add new auth endpoints
- add bookmars feat
- add reader feat
2026-06-03 22:06:01 -05:00

48 lines
1.3 KiB
Python

from pydantic_settings import BaseSettings
class Settings(BaseSettings):
"""Application settings via pydantic-settings. Reads from env vars and .env."""
# Django
DJANGO_SECRET_KEY: str = "django-insecure-change-me-in-production"
DJANGO_DEBUG: bool = False
DJANGO_ALLOWED_HOSTS: list[str] = ["*"]
# PostgreSQL
DB_NAME: str = "cloud_reader"
DB_USER: str = "postgres"
DB_PASSWORD: str = "postgres"
DB_HOST: str = "localhost"
DB_PORT: int = 5432
# JWT
JWT_ACCESS_TOKEN_LIFETIME_MINUTES: int = 60
JWT_REFRESH_TOKEN_LIFETIME_DAYS: int = 7
# CORS
CORS_ALLOWED_ORIGINS: list[str] = [
"http://localhost:5173",
"http://localhost:3000",
]
# Open Library metadata enrichment
OPENLIBRARY_ENABLED: bool = True
OPENLIBRARY_PREFERRED_LANG: str = "es"
OPENLIBRARY_FALLBACK_LANG: str = "en"
OPENLIBRARY_TIMEOUT_SECONDS: float = 10.0
OPENLIBRARY_CONNECT_TIMEOUT_SECONDS: float = 15.0
OPENLIBRARY_USER_AGENT: str = "CloudReader/1.0 (https://github.com/cloud-reader)"
@property
def DATABASE_URL(self) -> str:
return (
f"postgresql://{self.DB_USER}:{self.DB_PASSWORD}"
f"@{self.DB_HOST}:{self.DB_PORT}/{self.DB_NAME}"
)
model_config = {"env_file": ".env", "env_file_encoding": "utf-8"}
settings = Settings()