gwcelery.tools.flask module

Flask web application for manually triggering certain tasks.

class gwcelery.tools.flask.ScriptInfoWithCelery(app_import_path: str | None = None, create_app: t.Callable[..., Flask] | None = None, set_debug_flag: bool = True, load_dotenv_defaults: bool = True)[source]

Bases: ScriptInfo

ScriptInfo that also exposes .app for Celery’s daemon options.

class gwcelery.tools.flask.CeleryDaemonFlaskGroup(*args, **kwargs)[source]

Bases: FlaskGroup

make_context(info_name, args, parent=None, **extra)[source]

This function when given an info name and arguments will kick off the parsing and create a new Context. It does not invoke the actual command callback though.

To quickly customize the context class used without overriding this method, set the context_class attribute.

Parameters:
  • info_name – the info name for this invocation. Generally this is the most descriptive name for the script or command. For the toplevel script it’s usually the name of the script, for commands below it’s the name of the command.

  • args – the arguments to parse as list of strings.

  • parent – the parent context if available.

  • extra – extra keyword arguments forwarded to the context constructor.

Changed in version 8.0: Added the context_class attribute.

gwcelery.tools.flask.maybe_detached(*, detach, **kwargs)[source]