This document is for Celery's development version, which can be significantly different from previous releases. Get old docs here: 2.5.

celery.bin.base

Preload Options

--app

Fully qualified name of the app instance to use.

-b, --broker

Broker URL. Default is ‘amqp://guest:guest@localhost:5672//’

--loader

Name of the loader class to use. Taken from the environment variable CELERY_LOADER or ‘default’ if that is not set.

--config

Name of the module to read configuration from, default is ‘celeryconfig’.

Daemon Options

-f, --logfile

Path to log file. If no logfile is specified, stderr is used.

--pidfile

Optional file used to store the process pid.

The program will not start if this file already exists and the pid is still alive.

--uid

User id, or user name of the user to run as after detaching.

--gid

Group id, or group name of the main group to change to after detaching.

--umask

Effective umask of the process after detaching. Default is 0.

--workdir

Optional directory to change to after detaching.

class celery.bin.base.Command(app=None, get_app=None)

Base class for command line applications.

Parameters:
  • app – The current app.
  • get_app – Callable returning the current app if no app provided.
Parser

alias of OptionParser

args = ''

Arg list used in help.

check_args(args)
create_parser(prog_name, command=None)
die(msg, status=1)
doc = None
enable_config_from_cmdline = False

Enable if the application should support config from the cmdline.

execute_from_commandline(argv=None)

Execute application from command line.

Parameters:argv – The list of command line arguments. Defaults to sys.argv.
expanduser(value)
find_app(app)
get_cls_by_name(name)
get_options()

Get supported command line options.

handle_argv(prog_name, argv)

Parses command line arguments from argv and dispatches to run().

Parameters:
  • prog_name – The program name (argv[0]).
  • argv – Command arguments.

Exits with an error message if supports_args is disabled and argv contains positional arguments.

namespace = 'celery'

Default configuration namespace.

option_list = ()

List of options (without preload options).

parse_doc(doc)
parse_options(prog_name, arguments)

Parse the available options.

parse_preload_options(args)
preload_options = (<Option at 0x10af3fdd0: --app>, <Option at 0x10af3ff80: -b/--broker>, <Option at 0x10af3fe60: --loader>, <Option at 0x10af3fef0: --config>)

List of options to parse before parsing other options.

prepare_args(options, args)
prepare_parser(parser)
prepare_preload_options(options)

Optional handler to do additional processing of preload options.

Configuration must not have been initialized until after this is called.

process_cmdline_config(argv)
run(*args, **options)

This is the body of the command called by handle_argv().

setup_app_from_commandline(argv)
supports_args = True

If false the parser will raise an exception if positional args are provided.

symbol_by_name(name)
usage(command)

Returns the command-line usage string for this app.

version = '2.6.0rc2'

Application version.

celery.bin.base.daemon_options(default_pidfile=None, default_logfile=None)

Previous topic

celery.apps.beat

Next topic

celery.bin.celeryd

This Page