Commit Graph

19 Commits

Author SHA1 Message Date
Tim Graham 0ed7d15563 Sorted imports with isort; refs #23860. 2015-02-06 08:16:28 -05:00
Preston Timmons 5bc5ddd8b5 Fixed #24235 -- Removed is_usable attribute from template loaders. 2015-02-04 07:47:28 -05:00
Aymeric Augustin 118592663d Exposed Engine in the django.template namespace.
It's the main entrypoint to the refactored template system.
2015-01-07 21:54:22 +01:00
Aymeric Augustin ed220c4cbe Added comments to remove Engine.render_to_string in Django 2.0.
Since this is a private API introduced in Django 1.8, no documentation
is required.
2015-01-06 22:02:26 +01:00
Aymeric Augustin 84d7c93feb Raised an error when allowed_include_roots is a string.
This avoids leaving projects silently vulnerable when this option is set
to a string instead of a one-item tuple containing that string, a very
common misconfiguration.
2014-12-28 17:02:29 +01:00
Aymeric Augustin 90805b240f Supported multiple template engines in render_to_string.
Adjusted its API through a deprecation path according to the DEP.
2014-12-28 16:23:02 +01:00
Aymeric Augustin f9a6ebf6f5 Removed extraneous arguments in Engine.from_string.
This aligns the Django Template Engine API with the common template
backend API.
2014-12-28 16:23:02 +01:00
Aymeric Augustin 6854998c8f Looked up the default template engine in the list of all engines. 2014-12-28 16:23:01 +01:00
Aymeric Augustin b34b8a12b7 Passed a reference to the current engine when instantiating Template. 2014-12-28 16:23:00 +01:00
Aymeric Augustin bfa21ddf76 Renamed get_template_from_string to from_string.
The shorter name is just as explicit and, well, shorter.
2014-12-28 14:47:31 +01:00
Aymeric Augustin b3eda6ec3e Simplified handling of a default value. 2014-12-28 14:47:30 +01:00
Aymeric Augustin 6294bd3903 Encapsulated TEMPLATE_DEBUG in Engine. 2014-11-23 11:54:17 +01:00
Aymeric Augustin 37505b6397 Encapsulated TEMPLATE_CONTEXT_PROCESSORS in Engine.
Since RequestContext doesn't know its Engine until it's passed to
Template.render() -- and cannot without breaking a widely used public
API -- an elaborate hack is required to apply context processors.
2014-11-23 11:53:18 +01:00
Aymeric Augustin 246cfdeae3 Moved make_origin into the Engine class. 2014-11-23 11:52:45 +01:00
Aymeric Augustin 240ea67ce0 Move compile_string into the Engine class. 2014-11-23 11:52:25 +01:00
Aymeric Augustin a2dd08666c Removed dependency of template loaders on Django settings. 2014-11-23 11:52:14 +01:00
Aymeric Augustin 29a977ab14 Moved template loaders management in Engine.
Passed the engine instance to loaders. This is a prerequisite for
looking up configuration on the engine instance instead of global
settings.

This is backwards incompatible for custom template loaders that override
__init__. However the documentation doesn't talk about __init__ and the
way to pass arguments to custom template loaders isn't specified. I'm
considering it a private API.
2014-11-23 11:52:12 +01:00
Aymeric Augustin 544a716da8 Removed unused API get_template_loaders.
It was introduced in a recent refactoring so this isn't an issue.

Then renamed _get_template_loaders to get_template_loaders.
2014-11-23 11:51:31 +01:00
Aymeric Augustin 572cdb4391 Introduced a template engine class.
Moved Django templates loading infrastructure there.
2014-11-23 09:29:53 +01:00