tweaks
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
import os
|
||||
from dataclasses import dataclass
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
DEFAULT_SQLITE_PATH = (Path(__file__).resolve().parents[2] / "data_entry_app.db").as_posix()
|
||||
DEFAULT_DATABASE_URL = f"sqlite:///{DEFAULT_SQLITE_PATH}"
|
||||
|
||||
|
||||
DEFAULT_CORS_ALLOW_ORIGIN_REGEX = (
|
||||
@@ -63,7 +68,10 @@ class Settings:
|
||||
port=int(os.getenv("PORT", "8000")),
|
||||
log_level=os.getenv("LOG_LEVEL", "DEBUG" if os.getenv("LOG_VERBOSE") in {"1", "true", "TRUE", "yes", "on"} else "INFO"),
|
||||
log_verbose=_env_flag("LOG_VERBOSE"),
|
||||
database_url=os.getenv("DATABASE_URL", "sqlite:///./data_entry_app.db"),
|
||||
# Keep the default SQLite location stable regardless of the current
|
||||
# working directory so local dev does not silently fork data into
|
||||
# multiple `data_entry_app.db` files.
|
||||
database_url=os.getenv("DATABASE_URL", DEFAULT_DATABASE_URL),
|
||||
client_name=os.getenv("CLIENT_NAME", "Hunter Premium Produce"),
|
||||
client_email=os.getenv("CLIENT_EMAIL", "operator@example.com"),
|
||||
client_password=os.getenv("CLIENT_PASSWORD", "changeme"),
|
||||
|
||||
Reference in New Issue
Block a user