Skip to content

Commit

Permalink
Use env var
Browse files Browse the repository at this point in the history
  • Loading branch information
ahdamin committed Jan 23, 2025
1 parent eb9c6c4 commit 009099e
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions mock_api/src/config.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
from pathlib import Path

from dotenv import load_dotenv
from pydantic_settings import BaseSettings, SettingsConfigDict

dotenv_path = Path(__file__).resolve().parents[2] / ".env"
load_dotenv(dotenv_path)


class Settings(BaseSettings):
lims_host: str

model_config = SettingsConfigDict(
env_file=str(dotenv_path),
env_file_encoding="utf-8",
env_mapping={
"lims_host": "LIMS_HOST",
},
)


settings = Settings()
settings = Settings()

0 comments on commit 009099e

Please sign in to comment.