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 where HostEnvironment is being instantiated, or from the current working directory if it can't be calculated.

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.