class documentation

class FlaskGroup(AppGroup): (source)

View In Hierarchy

Special subclass of the :class:`AppGroup` group that supports loading more commands from the configured Flask app. Normally a developer does not have to interface with this class but there are some very advanced use cases for which it makes sense to create an instance of this. see :ref:`custom-scripts`. :param add_default_commands: if this is True then the default run and shell commands will be added. :param add_version_option: adds the ``--version`` option. :param create_app: an optional callback that is passed the script info and returns the loaded app. :param load_dotenv: Load the nearest :file:`.env` and :file:`.flaskenv` files to set environment variables. Will also change the working directory to the directory containing the first file found. :param set_debug_flag: Set the app's debug flag. .. versionchanged:: 2.2 Added the ``-A/--app``, ``--debug/--no-debug``, ``-e/--env-file`` options. .. versionchanged:: 2.2 An app context is pushed when running ``app.cli`` commands, so ``@with_appcontext`` is no longer required for those commands. .. versionchanged:: 1.0 If installed, python-dotenv will be used to load environment variables from :file:`.env` and :file:`.flaskenv` files.

Method __init__ Undocumented
Method get_command Undocumented
Method list_commands Undocumented
Method make_context Undocumented
Method parse_args Undocumented
Instance Variable create_app Undocumented
Instance Variable load_dotenv Undocumented
Instance Variable set_debug_flag Undocumented
Method _load_plugin_commands Undocumented
Instance Variable _loaded_plugin_commands Undocumented

Inherited from AppGroup:

Method command This works exactly like the method of the same name on a regular :class:`click.Group` but it wraps callbacks in :func:`with_appcontext` unless it's disabled by passing ``with_appcontext=False``.
Method group This works exactly like the method of the same name on a regular :class:`click.Group` but it defaults the group class to :class:`AppGroup`.
def __init__(self, add_default_commands: bool = True, create_app: t.Callable[..., Flask]|None = None, add_version_option: bool = True, load_dotenv: bool = True, set_debug_flag: bool = True, **extra: t.Any): (source)

Undocumented

def get_command(self, ctx, name): (source)

Undocumented

def list_commands(self, ctx): (source)

Undocumented

def make_context(self, info_name: str|None, args: list[str], parent: click.Context|None = None, **extra: t.Any) -> click.Context: (source)

Undocumented

def parse_args(self, ctx: click.Context, args: list[str]) -> list[str]: (source)

Undocumented

create_app = (source)

Undocumented

load_dotenv = (source)

Undocumented

set_debug_flag = (source)

Undocumented

def _load_plugin_commands(self): (source)

Undocumented

_loaded_plugin_commands: bool = (source)

Undocumented