| 1 |
""" |
| 2 |
Django's support for templates. |
| 3 |
|
| 4 |
The django.template namespace contains two independent subsystems: |
| 5 |
|
| 6 |
1. Multiple Template Engines: support for pluggable template backends, |
| 7 |
built-in backends and backend-independent APIs |
| 8 |
2. Django Template Language: Django's own template engine, including its |
| 9 |
built-in loaders, context processors, tags and filters. |
| 10 |
|
| 11 |
Ideally these subsystems would be implemented in distinct packages. However |
| 12 |
keeping them together made the implementation of Multiple Template Engines |
| 13 |
less disruptive . |
| 14 |
|
| 15 |
Here's a breakdown of which modules belong to which subsystem. |
| 16 |
|
| 17 |
Multiple Template Engines: |
| 18 |
|
| 19 |
- django.template.backends.* |
| 20 |
- django.template.loader |
| 21 |
- django.template.response |
| 22 |
|
| 23 |
Django Template Language: |
| 24 |
|
| 25 |
- django.template.base |
| 26 |
- django.template.context |
| 27 |
- django.template.context_processors |
| 28 |
- django.template.loaders.* |
| 29 |
- django.template.debug |
| 30 |
- django.template.defaultfilters |
| 31 |
- django.template.defaulttags |
| 32 |
- django.template.engine |
| 33 |
- django.template.loader_tags |
| 34 |
- django.template.smartif |
| 35 |
|
| 36 |
Shared: |
| 37 |
|
| 38 |
- django.template.utils |
| 39 |
|
| 40 |
""" |
| 41 |
|
| 42 |
# Multiple Template Engines |
| 43 |
|
| 44 |
from .engine import Engine |
| 45 |
from .utils import EngineHandler |
| 46 |
|
| 47 |
engines = EngineHandler() |
| 48 |
|
| 49 |
__all__ = ("Engine", "engines") |
| 50 |
|
| 51 |
|
| 52 |
# Django Template Language |
| 53 |
|
| 54 |
# Public exceptions |
| 55 |
from .base import VariableDoesNotExist # NOQA isort:skip |
| 56 |
from .context import Context, ContextPopException, RequestContext # NOQA isort:skip |
| 57 |
from .exceptions import TemplateDoesNotExist, TemplateSyntaxError # NOQA isort:skip |
| 58 |
|
| 59 |
# Template parts |
| 60 |
from .base import ( # NOQA isort:skip |
| 61 |
Node, |
| 62 |
NodeList, |
| 63 |
Origin, |
| 64 |
Template, |
| 65 |
Variable, |
| 66 |
) |
| 67 |
|
| 68 |
# Library management |
| 69 |
from .library import Library # NOQA isort:skip |
| 70 |
|
| 71 |
# Import the .autoreload module to trigger the registrations of signals. |
| 72 |
from . import autoreload # NOQA isort:skip |
| 73 |
|
| 74 |
__all__ += ("Template", "Context", "RequestContext") |