Add development mode with automatic test data seeding
This commit is contained in:
@@ -3,6 +3,9 @@ from functools import lru_cache
|
||||
|
||||
|
||||
class Settings(BaseSettings):
|
||||
# Environment
|
||||
env: str = "development" # "development" or "production"
|
||||
|
||||
# Server
|
||||
server_host: str = "0.0.0.0"
|
||||
server_port: int = 8080
|
||||
@@ -28,6 +31,14 @@ class Settings(BaseSettings):
|
||||
sslmode = f"?sslmode={self.database_sslmode}" if self.database_sslmode else ""
|
||||
return f"postgresql://{self.database_user}:{self.database_password}@{self.database_host}:{self.database_port}/{self.database_dbname}{sslmode}"
|
||||
|
||||
@property
|
||||
def is_development(self) -> bool:
|
||||
return self.env.lower() == "development"
|
||||
|
||||
@property
|
||||
def is_production(self) -> bool:
|
||||
return self.env.lower() == "production"
|
||||
|
||||
class Config:
|
||||
env_prefix = "ORCHARD_"
|
||||
case_sensitive = False
|
||||
|
||||
Reference in New Issue
Block a user