Skip to main content

locate_app

No overview available.

def locate_app(
module_name: str,
app_name: str | None,
raise_if_not_found: t.Literal[True] = True
) - > Flask

Attempts to find and instantiate a Flask application instance from a given module and optional attribute name.

Parameters

NameTypeDescription
module_namestrThe fully qualified name of the Python module to search for the application.
app_name`strNone`
raise_if_not_foundt.Literal[True] = TrueDetermines if an exception should be raised if the application cannot be located; defaults to True.

Returns

TypeDescription
FlaskThe discovered Flask application instance.