summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/templates/api.txt30
1 files changed, 29 insertions, 1 deletions
diff --git a/docs/ref/templates/api.txt b/docs/ref/templates/api.txt
index 4a9a73f758..6ff2dd6c7b 100644
--- a/docs/ref/templates/api.txt
+++ b/docs/ref/templates/api.txt
@@ -41,7 +41,7 @@ lower level APIs:
Configuring an engine
=====================
-.. class:: Engine([dirs][, app_dirs][, allowed_include_roots][, context_processors][, debug][, loaders][, string_if_invalid][, file_charset])
+.. class:: Engine([dirs][, app_dirs][, allowed_include_roots][, context_processors][, debug][, loaders][, string_if_invalid][, file_charset][, libraries][, builtins])
.. versionadded:: 1.8
@@ -114,6 +114,34 @@ Configuring an engine
It defaults to ``'utf-8'``.
+ * ``'libraries'``: A dictionary of labels and dotted Python paths of template
+ tag modules to register with the template engine. This is used to add new
+ libraries or provide alternate labels for existing ones. For example::
+
+ Engine(
+ libraries={
+ 'myapp_tags': 'path.to.myapp.tags',
+ 'admin.urls': 'django.contrib.admin.templatetags.admin_urls',
+ },
+ )
+
+ Libraries can be loaded by passing the corresponding dictionary key to
+ the :ttag:`{% load %}<load>` tag.
+
+ * ``'builtins'``: A list of dotted Python paths of template tag modules to
+ add to :doc:`built-ins </ref/templates/builtins>`. For example::
+
+ Engine(
+ builtins=['myapp.builtins'],
+ )
+
+ Tags and filters from built-in libraries can be used without first calling
+ the :ttag:`{% load %}<load>` tag.
+
+.. versionadded:: 1.9
+
+ The ``libraries`` and ``builtins`` arguments were added.
+
.. staticmethod:: Engine.get_default()
When a Django project configures one and only one