__init__.py 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. """
  2. Django's support for templates.
  3. The django.template namespace contains two independent subsystems:
  4. 1. Multiple Template Engines: support for pluggable template backends,
  5. built-in backends and backend-independent APIs
  6. 2. Django Template Language: Django's own template engine, including its
  7. built-in loaders, context processors, tags and filters.
  8. Ideally these subsystems would be implemented in distinct packages. However
  9. keeping them together made the implementation of Multiple Template Engines
  10. less disruptive .
  11. Here's a breakdown of which modules belong to which subsystem.
  12. Multiple Template Engines:
  13. - django.template.backends.*
  14. - django.template.loader
  15. - django.template.response
  16. Django Template Language:
  17. - django.template.base
  18. - django.template.context
  19. - django.template.context_processors
  20. - django.template.loaders.*
  21. - django.template.debug
  22. - django.template.defaultfilters
  23. - django.template.defaulttags
  24. - django.template.engine
  25. - django.template.loader_tags
  26. - django.template.smartif
  27. Shared:
  28. - django.template.utils
  29. """
  30. # Multiple Template Engines
  31. from .engine import Engine
  32. from .utils import EngineHandler
  33. engines = EngineHandler()
  34. __all__ = ('Engine', 'engines')
  35. # Django Template Language
  36. # Public exceptions
  37. from .base import VariableDoesNotExist # NOQA
  38. from .context import ContextPopException # NOQA
  39. from .exceptions import TemplateDoesNotExist, TemplateSyntaxError # NOQA
  40. # Template parts
  41. from .base import (Context, Node, NodeList, Origin, RequestContext, # NOQA
  42. Template, Variable)
  43. # Deprecated in Django 1.8, will be removed in Django 1.10.
  44. from .base import resolve_variable # NOQA
  45. # Library management
  46. from .library import Library # NOQA
  47. __all__ += ('Template', 'Context', 'RequestContext')