• Get Review Board
  • What's New
  • Products
  • Review Board Code review, image review, and document review
  • Documentation
  • Release Notes
  • Power Pack Enterprise integrations, reports, and enhanced document review
  • Try for 60 Days
  • Purchase
  • RBCommons Review Board as a Service, hosted by us
  • Pricing
  • RBTools Command line tools and Python API for Review Board
  • Documentation
  • Release Notes
  • Review Bot Automated code review, connecting tools you already use
  • Documentation
  • Release Notes
  • RB Gateway Manage Git and Mercurial repositories in your network
  • Documentation
  • Release Notes
  • Learn and Explore
  • What is Code Review?
  • Documentation
  • Frequently Asked Questions
  • Support Options
  • Third-Party Integrations
  • Demo
  • Review Board RBTools Power Pack Review Bot Djblets RB Gateway
    1. Djblets 0.9
    2. Version 5.x
    3. Version 4.x
    4. Version 3.x
    5. Version 2.x
    6. Version 2.0
    7. Version 1.0
    8. Version 0.9
    9. Djblets Documentation
    10. Module and Class References
    11. djblets.extensions.manager
  • Home
  • Guides
  • Extension Guides
  • Writing Extensions
  • Testing Extensions
  • Web API Guides
  • Writing Web API Resources
  • Module and Class References
  • djblets
  • djblets.auth.forms
  • djblets.auth.signals
  • djblets.auth.util
  • djblets.auth.views
  • djblets.cache.backend
  • djblets.cache.backend_compat
  • djblets.cache.context_processors
  • djblets.cache.errors
  • djblets.cache.forwarding_backend
  • djblets.cache.serials
  • djblets.configforms.forms
  • djblets.configforms.pages
  • djblets.configforms.views
  • djblets.datagrid.grids
  • djblets.db.backends.mysql.base
  • djblets.db.fields
  • djblets.db.managers
  • djblets.db.query
  • djblets.db.validators
  • djblets.extensions.errors
  • djblets.extensions.extension
  • djblets.extensions.forms
  • djblets.extensions.hooks
  • djblets.extensions.loaders
  • djblets.extensions.manager
  • djblets.extensions.middleware
  • djblets.extensions.models
  • djblets.extensions.packaging
  • djblets.extensions.resources
  • djblets.extensions.settings
  • djblets.extensions.signals
  • djblets.extensions.staticfiles
  • djblets.extensions.testing
  • djblets.extensions.testing.testcases
  • djblets.extensions.urls
  • djblets.extensions.views
  • djblets.extensions.templatetags.djblets_extensions
  • djblets.feedview.views
  • djblets.feedview.templatetags.feedtags
  • djblets.forms.fields
  • djblets.gravatars
  • djblets.gravatars.templatetags.gravatars
  • djblets.log
  • djblets.log.middleware
  • djblets.log.siteconfig
  • djblets.log.urls
  • djblets.log.views
  • djblets.mail.dmarc
  • djblets.mail.message
  • djblets.mail.testing
  • djblets.mail.utils
  • djblets.markdown
  • djblets.markdown.extensions.wysiwyg
  • djblets.markdown.extensions.wysiwyg_email
  • djblets.siteconfig.context_processors
  • djblets.siteconfig.django_settings
  • djblets.siteconfig.forms
  • djblets.siteconfig.managers
  • djblets.siteconfig.middleware
  • djblets.siteconfig.models
  • djblets.siteconfig.views
  • djblets.template.loaders.conditional_cached
  • djblets.template.loaders.namespaced_app_dirs
  • djblets.testing.decorators
  • djblets.testing.testcases
  • djblets.testing.testrunners
  • djblets.urls.context_processors
  • djblets.urls.decorators
  • djblets.urls.patterns
  • djblets.urls.resolvers
  • djblets.urls.root
  • djblets.urls.staticfiles
  • djblets.util.contextmanagers
  • djblets.util.dates
  • djblets.util.decorators
  • djblets.util.filesystem
  • djblets.util.http
  • djblets.util.humanize
  • djblets.util.serializers
  • djblets.util.views
  • djblets.util.templatetags.djblets_deco
  • djblets.util.templatetags.djblets_email
  • djblets.util.templatetags.djblets_forms
  • djblets.util.templatetags.djblets_images
  • djblets.util.templatetags.djblets_js
  • djblets.util.templatetags.djblets_utils
  • djblets.webapi.auth
  • djblets.webapi.auth.backends
  • djblets.webapi.auth.backends.api_tokens
  • djblets.webapi.auth.backends.base
  • djblets.webapi.auth.backends.basic
  • djblets.webapi.auth.views
  • djblets.webapi.decorators
  • djblets.webapi.encoders
  • djblets.webapi.errors
  • djblets.webapi.managers
  • djblets.webapi.models
  • djblets.webapi.resources
  • djblets.webapi.resources.base
  • djblets.webapi.resources.group
  • djblets.webapi.resources.registry
  • djblets.webapi.resources.root
  • djblets.webapi.resources.user
  • djblets.webapi.resources.mixins.api_tokens
  • djblets.webapi.resources.mixins.forms
  • djblets.webapi.resources.mixins.queries
  • djblets.webapi.responses
  • djblets.webapi.testing
  • djblets.webapi.testing.decorators
  • djblets.webapi.testing.testcases
  • djblets
  • djblets.auth.forms
  • djblets.auth.signals
  • djblets.auth.util
  • djblets.auth.views
  • djblets.cache.backend
  • djblets.cache.backend_compat
  • djblets.cache.context_processors
  • djblets.cache.errors
  • djblets.cache.forwarding_backend
  • djblets.cache.serials
  • djblets.configforms.forms
  • djblets.configforms.pages
  • djblets.configforms.views
  • djblets.datagrid.grids
  • djblets.db.backends.mysql.base
  • djblets.db.fields
  • djblets.db.managers
  • djblets.db.query
  • djblets.db.validators
  • djblets.extensions.errors
  • djblets.extensions.extension
  • djblets.extensions.forms
  • djblets.extensions.hooks
  • djblets.extensions.loaders
  • djblets.extensions.manager
  • djblets.extensions.middleware
  • djblets.extensions.models
  • djblets.extensions.packaging
  • djblets.extensions.resources
  • djblets.extensions.settings
  • djblets.extensions.signals
  • djblets.extensions.staticfiles
  • djblets.extensions.testing
  • djblets.extensions.testing.testcases
  • djblets.extensions.urls
  • djblets.extensions.views
  • djblets.extensions.templatetags.djblets_extensions
  • djblets.feedview.views
  • djblets.feedview.templatetags.feedtags
  • djblets.forms.fields
  • djblets.gravatars
  • djblets.gravatars.templatetags.gravatars
  • djblets.log
  • djblets.log.middleware
  • djblets.log.siteconfig
  • djblets.log.urls
  • djblets.log.views
  • djblets.mail.dmarc
  • djblets.mail.message
  • djblets.mail.testing
  • djblets.mail.utils
  • djblets.markdown
  • djblets.markdown.extensions.wysiwyg
  • djblets.markdown.extensions.wysiwyg_email
  • djblets.siteconfig.context_processors
  • djblets.siteconfig.django_settings
  • djblets.siteconfig.forms
  • djblets.siteconfig.managers
  • djblets.siteconfig.middleware
  • djblets.siteconfig.models
  • djblets.siteconfig.views
  • djblets.template.loaders.conditional_cached
  • djblets.template.loaders.namespaced_app_dirs
  • djblets.testing.decorators
  • djblets.testing.testcases
  • djblets.testing.testrunners
  • djblets.urls.context_processors
  • djblets.urls.decorators
  • djblets.urls.patterns
  • djblets.urls.resolvers
  • djblets.urls.root
  • djblets.urls.staticfiles
  • djblets.util.contextmanagers
  • djblets.util.dates
  • djblets.util.decorators
  • djblets.util.filesystem
  • djblets.util.http
  • djblets.util.humanize
  • djblets.util.serializers
  • djblets.util.views
  • djblets.util.templatetags.djblets_deco
  • djblets.util.templatetags.djblets_email
  • djblets.util.templatetags.djblets_forms
  • djblets.util.templatetags.djblets_images
  • djblets.util.templatetags.djblets_js
  • djblets.util.templatetags.djblets_utils
  • djblets.webapi.auth
  • djblets.webapi.auth.backends
  • djblets.webapi.auth.backends.api_tokens
  • djblets.webapi.auth.backends.base
  • djblets.webapi.auth.backends.basic
  • djblets.webapi.auth.views
  • djblets.webapi.decorators
  • djblets.webapi.encoders
  • djblets.webapi.errors
  • djblets.webapi.managers
  • djblets.webapi.models
  • djblets.webapi.resources
  • djblets.webapi.resources.base
  • djblets.webapi.resources.group
  • djblets.webapi.resources.registry
  • djblets.webapi.resources.root
  • djblets.webapi.resources.user
  • djblets.webapi.resources.mixins.api_tokens
  • djblets.webapi.resources.mixins.forms
  • djblets.webapi.resources.mixins.queries
  • djblets.webapi.responses
  • djblets.webapi.testing
  • djblets.webapi.testing.decorators
  • djblets.webapi.testing.testcases
  • General Index
  • Python Module Index
  • Release Notes
  • This documentation covers Djblets 0.9. You can select a version above or view the latest documentation.

    djblets.extensions.manager¶

    class SettingListWrapper(setting_name, display_name)[source]¶

    Bases: object

    Wraps list-based settings to provide management and ref counting.

    This can be used instead of direct access to a list in Django settings to ensure items are never added more than once, and only removed when nothing needs it anymore.

    Each item in the list is ref-counted. The initial items from the setting are populated and start with a ref count of 1. Adding items will increment a ref count for the item, adding it to the list if it doesn’t already exist. Removing items reduces the ref count, removing when it hits 0.

    __init__(setting_name, display_name)[source]¶
    add(item)[source]¶

    Adds an item to the setting.

    If the item is already in the list, it won’t be added again. The ref count will just be incremented.

    If it’s a new item, it will be added to the list with a ref count of 1.

    add_list(items)[source]¶

    Adds a list of items to the setting.

    remove(item)[source]¶

    Removes an item from the setting.

    The item’s ref count will be decremented. If it hits 0, it will be removed from the list.

    remove_list(items)[source]¶

    Removes a list of items from the setting.

    class ExtensionManager(key)[source]¶

    Bases: object

    A manager for all extensions.

    ExtensionManager manages the extensions available to a project. It can scan for new extensions, enable or disable them, determine dependencies, install into the database, and uninstall.

    An installed extension is one that has been installed by a Python package on the system.

    A registered extension is one that has been installed and information then placed in the database. This happens automatically after scanning for an installed extension. The registration data stores whether or not it’s enabled, and stores various pieces of information on the extension.

    An enabled extension is one that is actively enabled and hooked into the project.

    Each project should have one ExtensionManager.

    VERSION_SETTINGS_KEY = u’_extension_installed_version’[source]¶
    __init__(key)[source]¶
    get_url_patterns()[source]¶

    Returns the URL patterns for the Extension Manager.

    This should be included in the root urlpatterns for the site.

    is_expired()[source]¶

    Returns whether or not the extension state is possibly expired.

    Extension state covers the lists of extensions and each extension’s configuration. It can expire if the state synchronization value falls out of cache or is changed.

    Each ExtensionManager has its own state synchronization cache key.

    clear_sync_cache()[source]¶
    get_absolute_url()[source]¶
    get_can_disable_extension(registered_extension)[source]¶
    get_can_enable_extension(registered_extension)[source]¶
    get_enabled_extension(extension_id)[source]¶

    Returns an enabled extension with the given ID.

    get_enabled_extensions()[source]¶

    Returns the list of all enabled extensions.

    get_installed_extensions()[source]¶

    Returns the list of all installed extensions.

    get_installed_extension(extension_id)[source]¶

    Returns the installed extension with the given ID.

    get_dependent_extensions(dependency_extension_id)[source]¶

    Returns a list of all extensions required by an extension.

    enable_extension(extension_id)[source]¶

    Enables an extension.

    Enabling an extension will install any data files the extension may need, any tables in the database, perform any necessary database migrations, and then will start up the extension.

    disable_extension(extension_id)[source]¶

    Disables an extension.

    Disabling an extension will remove any data files the extension installed and then shut down the extension and all of its hooks.

    It will not delete any data from the database.

    install_extension(install_url, package_name)[source]¶

    Install an extension from a remote source.

    Installs an extension from a remote URL containing the extension egg. Installation may fail if a malformed install_url or package_name is passed, which will cause an InstallExtensionError exception to be raised. It is also assumed that the extension is not already installed.

    load(full_reload=False)[source]¶

    Loads all known extensions, initializing any that are recorded as being enabled.

    If this is called a second time, it will refresh the list of extensions, adding new ones and removing deleted ones.

    If full_reload is passed, all state is cleared and we reload all extensions and state from scratch.

    shutdown()[source]¶

    Shut down the extension manager and all of its extensions.

    install_extension_media(ext_class, force=False)[source]¶

    Installs extension static media.

    This method is a wrapper around _install_extension_media_internal to check whether we actually need to install extension media, and avoid contention among multiple threads/processes when doing so.

    We need to install extension media if it hasn’t been installed yet, or if the version of the extension media that we installed is different from the current version of the extension.

    get_extension_managers()[source]¶

    Return all extension manager instances.

    This will return all the extension managers that have been constructed. The order is not guaranteed.

    Returns:The list of ExtensionManager instances.
    Return type:list
    shutdown_extension_managers()[source]¶

    Shut down all extension managers.

    This is called automatically when the process exits, but can be run manually.

    Keep up with the latest Review Board releases, security updates, and helpful information.

    About
    News
    Demo
    RBCommons Hosting
    Integrations
    Happy Users
    Support Options
    Documentation
    FAQ
    User Manual
    RBTools
    Administration Guide
    Power Pack
    Release Notes
    Downloads
    Review Board
    RBTools
    Djblets
    Power Pack
    Package Store
    PGP Signatures
    Contributing
    Bug Tracker
    Submit Patches
    Development Setup
    Wiki
    Follow Us
    Mailing Lists
    Reddit
    Twitter
    Mastodon
    Facebook
    YouTube

    Copyright © 2006-2025 Beanbag, Inc. All rights reserved.

    Terms of Service — Privacy Policy — AI Ethics Policy — Branding

    On this page

    • [Top]