first commit
This commit is contained in:
34
app/core/config.py
Normal file
34
app/core/config.py
Normal file
@@ -0,0 +1,34 @@
|
||||
from __future__ import annotations
|
||||
from pydantic_settings import BaseSettings
|
||||
from pydantic import Field
|
||||
from dotenv import load_dotenv
|
||||
|
||||
load_dotenv()
|
||||
|
||||
|
||||
class Settings(BaseSettings):
|
||||
model_config = {
|
||||
"env_file": ".env",
|
||||
"extra": "allow",
|
||||
}
|
||||
|
||||
# Read DATABASE_URL from environment via model_config; avoid using Field(..., env=...)
|
||||
DATABASE_URL: str = "sqlite:///./dev.db"
|
||||
JWT_SECRET: str
|
||||
ALGORITHM: str = "HS256"
|
||||
ACCESS_TOKEN_EXPIRE_MINUTES: int = 15
|
||||
REFRESH_TOKEN_EXPIRE_DAYS: int = 30
|
||||
|
||||
GOOGLE_CLIENT_ID: str | None = None
|
||||
GOOGLE_CLIENT_SECRET: str | None = None
|
||||
GOOGLE_REDIRECT_URL: str | None = None
|
||||
|
||||
GITHUB_CLIENT_ID: str | None = None
|
||||
GITHUB_CLIENT_SECRET: str | None = None
|
||||
GITHUB_REDIRECT_URL: str | None = None
|
||||
|
||||
SERVER_NAME: str = "localhost:8000"
|
||||
DEBUG: bool = True
|
||||
|
||||
|
||||
settings = Settings()
|
||||
Reference in New Issue
Block a user