Created
June 2, 2024 02:33
-
-
Save Itsindigo/d1cd54526738f258874a9fe01950fde5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from dotenv import load_dotenv | |
from pydantic_settings import BaseSettings | |
dotenv_path = f"{os.getcwd()}/.env" | |
load_dotenv(dotenv_path) | |
class AppConfig(BaseSettings): | |
""" | |
Uses pydantic_settings to load configuration from environment variables. | |
If env var is not found matching the attribute name, the default value is used. | |
""" | |
API_DB_NAME: str = "api_db" # Default values can be overridden by env vars | |
API_DB_USER: str = "immi" | |
API_DB_PASSWORD: str | |
API_DB_PORT: str = "5432" | |
ENABLE_DETAILED_SQL_LOGGING: bool = False | |
WEBHOOK_VERIFICATION_SECRET: str |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment