find_app_by_string
Check if the given string is a variable name or a function. Call a function to get the app instance, or return the variable directly.
def find_app_by_string(
module: ModuleType,
app_name: string
) - > Flask
Check if the given string is a variable name or a function. Call a function to get the app instance, or return the variable directly.
Parameters
| Name | Type | Description |
|---|---|---|
| module | ModuleType | The Python module object where the application instance or factory function is defined. |
| app_name | string | The name of the attribute to retrieve or a function call string (e.g., 'create_app()') to execute within the module. |
Returns
| Type | Description |
|---|---|
Flask | The resolved Flask application instance extracted from the module attribute or factory function. |