Modified files
storeapi/config.py
---
+++
@@ -6,12 +6,28 @@
class BaseConfig(BaseSettings):
+ ENV_STATE: Optional[str] = None
+
"""Loads the dotenv file. Including this is necessary to get
pydantic to load a .env file."""
-
model_config = SettingsConfigDict(env_file=".env")
class GlobalConfig(BaseConfig):
DATABASE_URL: Optional[str] = None
DB_FORCE_ROLL_BACK: bool = False
+
+
+class DevConfig(GlobalConfig):
+ model_config = SettingsConfigDict(env_prefix="DEV_")
+
+
+class ProdConfig(GlobalConfig):
+ model_config = SettingsConfigDict(env_prefix="PROD_")
+
+
+class TestConfig(GlobalConfig):
+ DATABASE_URL: str = "sqlite:///test.db"
+ DB_FORCE_ROLL_BACK: bool = True
+
+ model_config = SettingsConfigDict(env_prefix="TEST_")