django.template.backends.django.get_installed_libraries.get - python examples

Here are the examples of the python api django.template.backends.django.get_installed_libraries.get taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

0 View Complete Implementation : compat.py
Copyright BSD 2-Clause "Simplified" License
Author : Styria-Digital
def get_templatetag_library(module):
    """Get the templatetag module's Library instance.

    Needed for extracting template tags and filters.

    Args:
        module {str}: module's name (e.g. 'app_tags')

    Returns:
        {Library}

    Raises:
        {AttributeError}: nonexistent module
        {InvalidTemplateLibrary}: the module does not have a variable
            named `register`

    """
    try:
        if import_library is not None and get_installed_libraries is not None:
            return import_library(get_installed_libraries().get(module))
        else:
            return get_library(module)
    except (AttributeError, InvalidTemplateLibrary):
        raise