Initial commit
This commit is contained in:
31
config/settings.py
Normal file
31
config/settings.py
Normal file
@@ -0,0 +1,31 @@
|
||||
# config/settings.py
|
||||
from pydantic_settings import BaseSettings # This is the correct import for Pydantic v2
|
||||
from typing import Optional
|
||||
|
||||
|
||||
class Settings(BaseSettings):
|
||||
# Database
|
||||
database_url: str = "sqlite:///./ecommerce.db"
|
||||
|
||||
# JWT
|
||||
jwt_secret_key: str = "change-this-in-production"
|
||||
jwt_expire_hours: int = 24
|
||||
|
||||
# API
|
||||
api_host: str = "0.0.0.0"
|
||||
api_port: int = 8000
|
||||
debug: bool = False
|
||||
|
||||
# Rate Limiting
|
||||
rate_limit_enabled: bool = True
|
||||
default_rate_limit: int = 100
|
||||
default_window_seconds: int = 3600
|
||||
|
||||
# Logging
|
||||
log_level: str = "INFO"
|
||||
log_file: Optional[str] = None
|
||||
|
||||
model_config = {"env_file": ".env"} # Updated syntax for Pydantic v2
|
||||
|
||||
|
||||
settings = Settings()
|
||||
Reference in New Issue
Block a user