• 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 5.x
    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.templatetags.djblets_extensions
  • Home
  • Guides
  • Avatar Services Guides
  • Writing Avatar Services
  • Extension Guides
  • Writing Extensions
  • Testing Extensions
  • Feature Checks Guides
  • Introduction to Feature Checks
  • Writing Features
  • Writing Feature Checkers
  • Testing with Feature Checks
  • Integration Guides
  • Supporting Integrations
  • Writing Integrations
  • Privacy Compliance Guides
  • Getting and Checking Consent
  • Working with Personally Identifiable Information
  • Service Integrations
  • reCAPTCHA Guides
  • Using reCAPTCHA
  • Registries Guides
  • Writing Registries
  • Web API Guides
  • Writing Web API Resources
  • Adding OAuth2 Support
  • Module and Class References
  • djblets
  • djblets.deprecation
  • djblets.auth.forms
  • djblets.auth.ratelimit
  • djblets.auth.signals
  • djblets.auth.util
  • djblets.auth.views
  • djblets.avatars.errors
  • djblets.avatars.forms
  • djblets.avatars.registry
  • djblets.avatars.services
  • djblets.avatars.services.base
  • djblets.avatars.services.fallback
  • djblets.avatars.services.file_upload
  • djblets.avatars.services.gravatar
  • djblets.avatars.services.url
  • djblets.avatars.settings
  • djblets.cache.backend
  • djblets.cache.backend_compat
  • djblets.cache.context_processors
  • djblets.cache.errors
  • djblets.cache.forwarding_backend
  • djblets.cache.serials
  • djblets.cache.synchronizer
  • djblets.conditions
  • djblets.conditions.choices
  • djblets.conditions.conditions
  • djblets.conditions.errors
  • djblets.conditions.operators
  • djblets.conditions.values
  • djblets.configforms.forms
  • djblets.configforms.mixins
  • djblets.configforms.pages
  • djblets.configforms.registry
  • djblets.configforms.views
  • djblets.datagrid.grids
  • djblets.db.backends.mysql.base
  • djblets.db.fields
  • djblets.db.fields.base64_field
  • djblets.db.fields.comma_separated_values_field
  • djblets.db.fields.counter_field
  • djblets.db.fields.json_field
  • djblets.db.fields.modification_timestamp_field
  • djblets.db.fields.relation_counter_field
  • djblets.db.managers
  • djblets.db.query
  • djblets.db.query_catcher
  • djblets.db.query_comparator
  • djblets.db.validators
  • djblets.extensions.admin
  • 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.features
  • djblets.features.checkers
  • djblets.features.decorators
  • djblets.features.errors
  • djblets.features.feature
  • djblets.features.level
  • djblets.features.registry
  • djblets.features.testing
  • djblets.features.templatetags.features
  • djblets.forms.fields
  • djblets.forms.fieldsets
  • djblets.forms.forms
  • djblets.forms.forms.key_value_form
  • djblets.forms.widgets
  • djblets.gravatars
  • djblets.gravatars.templatetags.gravatars
  • djblets.http.middleware
  • djblets.http.responses
  • djblets.integrations.errors
  • djblets.integrations.forms
  • djblets.integrations.hooks
  • djblets.integrations.integration
  • djblets.integrations.manager
  • djblets.integrations.mixins
  • djblets.integrations.models
  • djblets.integrations.urls
  • djblets.integrations.views
  • 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.escape_html
  • djblets.markdown.extensions.wysiwyg
  • djblets.markdown.extensions.wysiwyg_email
  • djblets.pipeline.compilers.es6
  • djblets.pipeline.compilers.less
  • djblets.pipeline.compilers.mixins
  • djblets.pipeline.compilers.rollup
  • djblets.pipeline.compilers.typescript
  • djblets.pipeline.settings
  • djblets.privacy.consent
  • djblets.privacy.consent.base
  • djblets.privacy.consent.common
  • djblets.privacy.consent.errors
  • djblets.privacy.consent.forms
  • djblets.privacy.consent.hooks
  • djblets.privacy.consent.registry
  • djblets.privacy.consent.tracker
  • djblets.privacy.models
  • djblets.privacy.pii
  • djblets.privacy.templatetags.djblets_privacy
  • djblets.recaptcha.mixins
  • djblets.recaptcha.siteconfig
  • djblets.recaptcha.templatetags.djblets_recaptcha
  • djblets.recaptcha.widgets
  • djblets.registries
  • djblets.registries.errors
  • djblets.registries.importer
  • djblets.registries.mixins
  • djblets.registries.registry
  • djblets.registries.signals
  • djblets.secrets
  • djblets.secrets.crypto
  • djblets.secrets.token_generators
  • djblets.secrets.token_generators.base
  • djblets.secrets.token_generators.legacy_sha1
  • djblets.secrets.token_generators.registry
  • djblets.secrets.token_generators.vendor_checksum
  • djblets.siteconfig
  • djblets.siteconfig.admin
  • djblets.siteconfig.context_processors
  • djblets.siteconfig.django_settings
  • djblets.siteconfig.forms
  • djblets.siteconfig.managers
  • djblets.siteconfig.middleware
  • djblets.siteconfig.models
  • djblets.siteconfig.signals
  • djblets.siteconfig.views
  • djblets.template.caches
  • djblets.template.context
  • 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.compat.django.core.cache
  • djblets.util.compat.python.past
  • djblets.util.contextmanagers
  • djblets.util.dates
  • djblets.util.decorators
  • djblets.util.filesystem
  • djblets.util.functional
  • djblets.util.html
  • djblets.util.http
  • djblets.util.humanize
  • djblets.util.json_utils
  • djblets.util.properties
  • djblets.util.serializers
  • djblets.util.symbols
  • 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.util.typing
  • djblets.util.views
  • djblets.views.generic.base
  • djblets.views.generic.etag
  • 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.backends.oauth2_tokens
  • djblets.webapi.auth.views
  • djblets.webapi.decorators
  • djblets.webapi.encoders
  • djblets.webapi.errors
  • djblets.webapi.fields
  • djblets.webapi.managers
  • djblets.webapi.models
  • djblets.webapi.oauth2_scopes
  • 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.oauth2_tokens
  • djblets.webapi.resources.mixins.queries
  • djblets.webapi.responses
  • djblets.webapi.signals
  • djblets.webapi.testing
  • djblets.webapi.testing.decorators
  • djblets.webapi.testing.testcases
  • General Index
  • Python Module Index
  • Release Notes
  • djblets.extensions.templatetags.djblets_extensions¶

    Template tags for loading extension static media.

    class ExtensionStaticMediaNodeMixin[source]¶

    Bases: object

    Mixin for extension-specific static media rendering logic.

    This is used to change the behavior for how static media in extensions are rendered, allowing us to work with both development setups and installed packages.

    render_compressed(*args, **kwargs)[source]¶

    Render an extension media bundle to HTML.

    If Pipeline is disabled (typically on development setups), this will attempt to render the compressed files, as normal. However, if that fails (due to the source files not being available in a package) or Pipeline is enabled (typically on a production setup), the bundle’s output file will be rendered instead.

    Parameters:
    • *args (tuple) – Positional arguments to pass to the rendering function.

    • **kwargs (dict) – Keyword arguments to pass to the rendering function.

    Returns:

    The HTML for loading the static media.

    Return type:

    django.utils.safestring.SafeText

    class ExtensionJavascriptNode(name)[source]¶

    Bases: ExtensionStaticMediaNodeMixin, JavascriptNode

    Template node for including extension-specific JavaScript.

    This will allow both extensions in development mode or installed via a package to be used on a page.

    __annotations__ = {}¶
    class ExtensionStylesheetNode(name)[source]¶

    Bases: ExtensionStaticMediaNodeMixin, StylesheetNode

    Template node for including extension-specific CSS.

    This will allow both extensions in development mode or installed via a package to be used on a page.

    __annotations__ = {}¶
    template_hook_point(context: Union[Context, RequestContext], name: str) → SafeString[source]¶

    Register a place where TemplateHooks can render to.

    Parameters:
    • context (dict) – The template rendering context.

    • name (str) – The name of the CSS bundle to render.

    Returns:

    The rendered HTML.

    Return type:

    django.utils.safetext.SafeString

    ext_static(context: Context, extension: Extension, path: str) → str[source]¶

    Return the URL to the given static media file provided by an extension.

    This works like the {% static %} template tag, but takes an extension and generates a URL for the media file within the extension.

    This is meant to be used with djblets.extensions.staticfiles.ExtensionFinder.

    Parameters:
    • context (django.template.Context) – The current template context.

    • extension (djblets.extensions.extension.Extension) – The extension that owns the static media file.

    • path (str) – The relative path to the static media file.

    Returns:

    The resulting URL to the static media file.

    Return type:

    str

    ext_css_bundle(context: Context, extension: Extension, name: str) → SafeString[source]¶

    Return HTML to import an extension’s CSS bundle.

    Parameters:
    • context (django.template.Context) – The current template context.

    • extension (djblets.extensions.extension.Extension) – The extension instance.

    • name (str) – The name of the CSS bundle to render.

    Returns:

    The rendered HTML.

    Return type:

    django.utils.safestring.SafeString

    ext_js_bundle(context: Context, extension: Extension, name: str) → SafeString[source]¶

    Return HTML to import an extension’s JavaScript bundle.

    Parameters:
    • context (django.template.Context) – The current template context.

    • extension (djblets.extensions.extension.Extension) – The extension instance.

    • name (unicode) – The name of the CSS bundle to render.

    Returns:

    The rendered HTML.

    Return type:

    django.utils.safestring.SafeString

    load_extensions_css(context: Context, extension_manager_key: str, default_bundles: str = 'default') → SafeString[source]¶

    Load all CSS bundles that can be rendered on the current page.

    This will include all “default” bundles and any with an apply_to containing a URL name matching the current page.

    Parameters:
    • context (django.template.Context) – The template context.

    • extension_manager_key (str) – The key for the extension manager for these bundles.

    • default_bundles (str) – A string containing a comma-separated list of bundles to always include. Defaults to "default".

    Returns:

    The HTML used to include the bundled content.

    Return type:

    django.utils.safestring.SafeString

    load_extensions_js(context: Context, extension_manager_key: str, default_bundles: str = 'default') → SafeString[source]¶

    Load all JavaScript bundles that can be rendered on the current page.

    This will include all “default” bundles and any with an apply_to containing a URL name matching the current page.

    Parameters:
    • context (django.template.Context) – The template context.

    • extension_manager_key (str) – The key for the extension manager for these bundles.

    • default_bundles (str) – A string containing a comma-separated list of bundles to always include. Defaults to "default".

    Returns:

    The HTML used to include the bundled content.

    Return type:

    django.utils.safestring.SafeString

    init_js_extensions(context: Context, extension_manager_key: str) → dict[str, Any][source]¶

    Initializes all JavaScript extensions.

    Each extension’s required JavaScript files will be loaded in the page, and their JavaScript-side Extension subclasses will be instantiated.

    Parameters:
    • context (django.template.Context) – The current template context.

    • extension_manager_key (str) – The key for the extension manager for these bundles.

    Returns:

    Context variables to include for the extensions/init_js_extensions.html template.

    Return type:

    dict

    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]
    • ExtensionStaticMediaNodeMixin
      • ExtensionStaticMediaNodeMixin.render_compressed()
    • ExtensionJavascriptNode
      • ExtensionJavascriptNode.__annotations__
    • ExtensionStylesheetNode
      • ExtensionStylesheetNode.__annotations__
    • template_hook_point()
    • ext_static()
    • ext_css_bundle()
    • ext_js_bundle()
    • load_extensions_css()
    • load_extensions_js()
    • init_js_extensions()