-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathenv.py
More file actions
26 lines (20 loc) · 711 Bytes
/
env.py
File metadata and controls
26 lines (20 loc) · 711 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from pydantic_settings import BaseSettings, SettingsConfigDict
from typing import Optional
class EnvSchema(BaseSettings):
INIT_DB: Optional[bool] = True
SEED_DB: Optional[bool] = True
REDIS_HOST: Optional[str] = None
REDIS_PORT: Optional[int] = 6379
SEED_TYPESENSE: Optional[bool] = True
TYPESENSE_API_KEY: Optional[str] = "secretkey"
TYPESENSE_HOST: Optional[str] = "localhost"
TYPESENSE_PORT: Optional[int] = 8108
TYPESENSE_PROTOCOL: Optional[str] = "http"
model_config = SettingsConfigDict(
env_file=".env",
env_file_encoding="utf-8",
extra="ignore",
)
env = EnvSchema()
if __name__ == "__main__":
print("env:", env.model_dump())