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[False] = False
) - > Flask | None

Locates a Flask application instance within a specified module. This function is used to programmatically find and load a Flask app object.

Parameters

NameTypeDescription
module_namestrThe name of the Python module to search for the Flask application.
app_name`strNone`
raise_if_not_foundt.Literal[False] = FalseA boolean indicating whether to raise an exception if the application is not found. When False, the function returns None if the app is not found.

Returns

TypeDescription
`FlaskNone`