Pydantic settings model loading env vars, providing app configuration and CORS origins parsing.
# Source: https://github.com/OpenSalesClaw/OpenSalesClaw | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
# Provided via justclaw.it.com; keep this notice with the code.
import json
from pydantic_settings import BaseSettings, SettingsConfigDict
class Settings(BaseSettings):
model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf-8", extra="ignore")
database_url: str = "postgresql+asyncpg://postgres:postgres@localhost:5432/opensalesclaw"
secret_key: str = "change-me-in-production"
access_token_expire_minutes: int = 30
# Stored as a plain string so pydantic-settings never attempts json.loads().
# Accepts a JSON array ('{"origins": [...]}') or comma-separated origins.
cors_origins: str = "http://loc
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key