This document describes the current stable version of Celery (5.7). For development docs, go here.

celery.app.utils

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

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

Celery settings object.

Changed in version 5.7: Preconfigured values are no longer copied into the built-in defaults mapping.

property broker_read_url
property broker_url
property broker_write_url
copy()[source]
finalize()[source]
find_option(name, namespace='')[source]

Search for option by name.

Example

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

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

Returns:

of (namespace, key, type).

Return type:

Tuple

find_value_for_key(name, namespace='celery')[source]

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

get_by_parts(*parts)[source]

Return the current value for setting specified as a path.

Example

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

Return a human readable text showing configuration changes.

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

Return the current configuration, but without defaults.

celery.app.utils.appstr(app)[source]

String used in __repr__ etc, to id app instances.

celery.app.utils.bugreport(app)[source]

Return a string containing information useful in bug-reports.

celery.app.utils.filter_hidden_settings(conf)[source]

Filter sensitive settings.

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

Find app by name.

celery.app.utils.sanitize_url(url, mask='********')[source]

Sanitize URL, masking passwords.

Supports: - Standard single-server URLs (e.g. redis://:secret@localhost:6379/0) - Passwords containing separators such as semicolons or commas - Multi-server URLs with shared scheme (e.g. cache+memcached://user:secret@s1:11211;s2:11211/) - Redis Sentinel multi-node URLs (e.g. sentinel://:secret@h1:26379;sentinel://:secret@h2:26379/0

or sentinel://:secret@h1:26379;h2:26379/0)

  • URLs with query strings containing semicolons (e.g. redis://user:secret@localhost:6379?a=1;b=2)

  • Azure Storage connection strings (e.g. azureblockblob://AccountKey=SECRET;...)

Fails closed on malformed URLs to prevent credential leakage.