celery.app.utils

celery.app.utils

App utilities: Compat settings, bugreport tool, pickling apps.

class celery.app.utils.Settings(changes, defaults)[源代码]

Celery settings object.

  • BROKER_BACKEND None[源代码]

    Deprecated compat alias to BROKER_TRANSPORT.

  • BROKER_TRANSPORT None[源代码]

  • BROKER_URL None

  • CELERY_RESULT_BACKEND None[源代码]

  • CELERY_TIMEZONE None[源代码]

  • find_option(name, namespace=’celery’)[源代码]

    Search for option by name.

    Will return (namespace, key, type) tuple, e.g.:

    1. >>> from proj.celery import app
    2. >>> app.conf.find_option('disable_rate_limits')
    3. ('CELERY', 'DISABLE_RATE_LIMITS',
    4. <Option: type->bool default->False>))
    参数:
    • name – Name of option, cannot be partial.
    • namespace – Preferred namespace (CELERY by default).
  • 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.

    Example:

    1. >>> from proj.celery import app
    2. >>> app.conf.get_by_parts('CELERY', 'DISABLE_RATE_LIMITS')
    3. False
  • humanize(with_defaults=False, censored=True)[源代码]

    Return a human readable string showing changes to the configuration.

  • table(with_defaults=False, censored=True)

  • 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)

celery.app.utils.find_app(app, symbol_by_name=<function symbol_by_name at 0x9402a04>, imp=<function import_from_cwd at 0xb08d87c>)