Skip to content

Commit

Permalink
prefix env vars with XLWINGS_
Browse files Browse the repository at this point in the history
  • Loading branch information
fzumstein committed Apr 29, 2024
1 parent fb2dd99 commit 078bdd7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@


class Settings(BaseSettings):
model_config = SettingsConfigDict(env_file=os.getenv("DOTENV_PATH", ".env"))
model_config = SettingsConfigDict(
env_prefix="XLWINGS_", env_file=os.getenv("DOTENV_PATH", ".env")
)
add_security_headers: bool = True
base_dir: Path = Path(__file__).resolve().parent
cors_allow_origins: List[str] = ["*"]
Expand All @@ -24,10 +26,10 @@ class Settings(BaseSettings):
log_level: str = "INFO"
public_addin_store: bool = False
static_dir: Path = base_dir / "static"
xlwings_license_key: str
license_key: str


settings = Settings()

if not os.getenv("XLWINGS_LICENSE_KEY"):
os.environ["XLWINGS_LICENSE_KEY"] = settings.xlwings_license_key
os.environ["XLWINGS_LICENSE_KEY"] = settings.license_key

0 comments on commit 078bdd7

Please sign in to comment.