Skip to content

HostEnvironment

Provide information about the hosting environment an application is running in.

content_root_path property

content_root_path: str

Absolute path to the directory that contains the application content files.

environment_name property

environment_name: str

Environment name.

__init__

__init__(content_root_path: str | None = None) -> None

Initialize the host environment.

Args: content_root_path: Absolute path to the directory that contains the application content files. If not provided, the content root path will be inferred from the caller file path.

is_development

is_development() -> bool

Check if the current host environment name is development.

is_environment

is_environment(environment_name: str) -> bool

Compare the current host environment name against the specified value.

is_local

is_local() -> bool

Check if the current host environment name is local.

is_production

is_production() -> bool

Check if the current host environment name is production.

is_staging

is_staging() -> bool

Check if the current host environment name is staging.