celery.app.utils

App utilities: Compat settings, bug-report tool, pickling apps.

class celery.app.utils.Settings(*args, deprecated_settings=None, **kwargs)[源代码]

Celery settings object.

property broker_read_url
property broker_url
property broker_write_url
finalize()[源代码]
find_option(name, namespace='')[源代码]

Search for option by name.

示例

>>> from proj.celery import app
>>> app.conf.find_option('disable_rate_limits')
('worker', 'prefetch_multiplier',
 <Option: type->bool default->False>))
参数:
  • name (str) -- Name of option, cannot be partial.

  • namespace (str) -- Preferred name-space (None by default).

返回:

of (namespace, key, type).

返回类型:

Tuple

find_value_for_key(name, namespace='celery')[源代码]

Shortcut to get_by_parts(*find_option(name)[:-1]).

get_by_parts(*parts)[源代码]

Return the current value for setting specified as a path.

示例

>>> from proj.celery import app
>>> app.conf.get_by_parts('worker', 'disable_rate_limits')
False
humanize(with_defaults=False, censored=True)[源代码]

Return a human readable text showing configuration changes.

maybe_warn_deprecated_settings()[源代码]
property result_backend
table(with_defaults=False, censored=True)[源代码]
property task_default_exchange
property task_default_routing_key
property timezone
value_set_for(key)[源代码]
without_defaults()[源代码]

Return the current configuration, but without defaults.

celery.app.utils.appstr(app)[源代码]

String used in __repr__ etc, to id app instances.

celery.app.utils.bugreport(app)[源代码]

Return a string containing information useful in bug-reports.

celery.app.utils.filter_hidden_settings(conf)[源代码]

Filter sensitive settings.

celery.app.utils.find_app(app, symbol_by_name=<function symbol_by_name>, imp=<function import_from_cwd>)[源代码]

Find app by name.