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: str
) - > 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 to search within for the application. |
| app_name | str | The name of the Flask application, which can be a variable name or a function call string (e.g., 'app' or 'create_app()'). |
Returns
| Type | Description |
|---|---|
Flask | The Flask application instance. |