Skip to content

Plugin API

from litestar_granian import GranianPlugin, __project__, __version__

Plugin

GranianPlugin

GranianPlugin(*, static='off')

Bases: InitPlugin, CLIPluginProtocol

Register the supervised Granian runtime with Litestar's CLI.

Parameters:

Name Type Description Default
static StaticMode

Native static-file discovery mode. "off" keeps Litestar's static routing. "auto" consumes exactly one compatible static provider when its configuration is safe, otherwise it falls back to Litestar. Explicit CLI mounts always take precedence.

'off'

Raises:

Type Description
ValueError

If static is not one of the documented literal values.

Attributes:

Name Type Description
staticStaticMode

Configured native static-file discovery mode ("off" or "auto").

StaticMode

StaticMode = Literal['off', 'auto']

Package Metadata

__project__

__project__ = metadata('litestar_granian')['Name']

Name of the project.

__version__

__version__ = version('litestar_granian')

Version of the project.