2026-02-02 23:11:27 +09:00
|
|
|
"""
|
|
|
|
|
Application configuration using Pydantic Settings.
|
|
|
|
|
"""
|
2026-03-20 12:27:05 +09:00
|
|
|
|
2026-02-02 23:11:27 +09:00
|
|
|
from pydantic_settings import BaseSettings
|
|
|
|
|
from functools import lru_cache
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
|
|
|
# Application
|
2026-02-05 23:24:53 +09:00
|
|
|
app_name: str = "Galaxis-Po"
|
2026-02-02 23:11:27 +09:00
|
|
|
debug: bool = False
|
|
|
|
|
|
|
|
|
|
# Database
|
2026-03-20 12:27:05 +09:00
|
|
|
database_url: str
|
2026-02-02 23:11:27 +09:00
|
|
|
|
|
|
|
|
# JWT
|
2026-03-20 12:27:05 +09:00
|
|
|
jwt_secret: str
|
2026-02-02 23:11:27 +09:00
|
|
|
jwt_algorithm: str = "HS256"
|
|
|
|
|
access_token_expire_minutes: int = 60 * 24 # 24 hours
|
|
|
|
|
|
2026-02-07 23:09:22 +09:00
|
|
|
# CORS
|
|
|
|
|
cors_origins: str = "http://localhost:3000"
|
|
|
|
|
|
2026-02-08 22:21:36 +09:00
|
|
|
# Admin user (auto-created on startup if not exists)
|
|
|
|
|
admin_username: str = ""
|
|
|
|
|
admin_email: str = ""
|
|
|
|
|
admin_password: str = ""
|
|
|
|
|
|
2026-02-02 23:11:27 +09:00
|
|
|
# External APIs
|
|
|
|
|
kis_app_key: str = ""
|
|
|
|
|
kis_app_secret: str = ""
|
|
|
|
|
kis_account_no: str = ""
|
|
|
|
|
dart_api_key: str = ""
|
|
|
|
|
|
|
|
|
|
class Config:
|
|
|
|
|
env_file = ".env"
|
|
|
|
|
case_sensitive = False
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@lru_cache
|
|
|
|
|
def get_settings() -> Settings:
|
|
|
|
|
return Settings()
|