32 lines
872 B
Python
32 lines
872 B
Python
import os
|
|
from dotenv import load_dotenv
|
|
|
|
load_dotenv()
|
|
|
|
class Settings:
|
|
# Database
|
|
DATABASE_URL: str = os.getenv("DATABASE_URL", "postgresql://username:password@localhost:5432/itdontfitgsapi")
|
|
|
|
# Security
|
|
SECRET_TOKEN: str = os.getenv("SECRET_TOKEN", "your_secret_token_here")
|
|
|
|
# Server
|
|
API_HOST: str = os.getenv("API_HOST", "0.0.0.0")
|
|
API_PORT: int = int(os.getenv("API_PORT", "8000"))
|
|
|
|
# Environment
|
|
ENVIRONMENT: str = os.getenv("ENVIRONMENT", "development")
|
|
DEBUG: bool = os.getenv("DEBUG", "true").lower() == "true"
|
|
|
|
# SSL
|
|
SSL_REDIRECT: bool = os.getenv("SSL_REDIRECT", "false").lower() == "true"
|
|
|
|
# Logging
|
|
LOG_LEVEL: str = os.getenv("LOG_LEVEL", "INFO")
|
|
|
|
@property
|
|
def is_production(self) -> bool:
|
|
return self.ENVIRONMENT.lower() == "production"
|
|
|
|
settings = Settings()
|