summaryrefslogtreecommitdiff
path: root/django/template/loader.py
AgeCommit message (Collapse)Author
2017-02-17Refs #27656 -- Updated django.template/tag docstring verbs according to PEP 257.Anton Samarchyan
2017-01-18Refs #23919 -- Removed six.<various>_types usageClaude Paroz
Thanks Tim Graham and Simon Charette for the reviews.
2017-01-17Refs #25466 -- Removed aliases for LoaderOrigin and StringOrigin.Tim Graham
Per deprecation timeline.
2016-01-25Fixed #26109 -- Raised a helpful error if loader.select_tamplate() is passed ↵Ahmed Mohamed
a string.
2015-09-29Fixed #25466 -- Added backwards compatibility aliases for LoaderOrigin and ↵Tim Graham
StringOrigin. Thanks Simon Charette for the DeprecationInstanceCheck class.
2015-09-23Removed template.loader.BaseLoader per deprecation timeline.Tim Graham
2015-09-23Removed dictionary and context_instance parameters for render functions.Tim Graham
Per deprecation timeline.
2015-09-23Removed dirs parameter in template engine methods and related funtions.Tim Graham
Per deprecation timeline.
2015-06-29Removed unreachable codeAndriy Sokolovskiy
2015-06-24Renamed RemovedInDjangoXYWarnings for new roadmap.Tim Graham
Forwardport of ae1d663b7913f6da233c55409c4973248372d302 from stable/1.8.x plus more.
2015-05-06Moved engine-related exceptions to django.template.exceptions.Preston Timmons
With the introduction of multiple template engines these exceptions are no longer DTL-specific. It makes more sense for them to be moved out of DTL-related modules.
2015-05-06Fixed #24119, #24120 -- Formalized debug integration for template backends.Preston Timmons
2015-04-22Fixed #15053 -- Enabled recursive template loading.Preston Timmons
2015-03-20Cleaned up the template debug implementation.Preston Timmons
This patch does three major things: * Merges the django.template.debug implementation into django.template.base. * Simplifies the debug implementation. The old implementation copied debug information to every token and node. The django_template_source attribute was set in multiple places, some quite hacky, like django.template.defaulttags.ForNode. Debug information is now annotated in two high-level places: * Template.compile_nodelist for errors during parsing * Node.render_annotated for errors during rendering These were chosen because they have access to the template and context as well as to all exceptions that happen during either the parse or render phase. * Moves the contextual line traceback information creation from django.views.debug into django.template.base.Template. The debug views now only deal with the presentation of the debug information.
2015-02-06Sorted imports with isort; refs #23860.Tim Graham
2015-01-07Added a request argument to render_to_string.Aymeric Augustin
This is for consistency with Template.render. It adds a little bit of knowledge about HTTP requests in django.template.loader but I think consistency trumps purity.
2015-01-06Added comments to remove Engine.render_to_string in Django 2.0.Aymeric Augustin
Since this is a private API introduced in Django 1.8, no documentation is required.
2014-12-28Supported multiple template engines in render_to_string.Aymeric Augustin
Adjusted its API through a deprecation path according to the DEP.
2014-12-28Removed private API get_template_from_string.Aymeric Augustin
It wasn't documented and it wasn't used anywhere.
2014-12-28Removed private API find_template.Aymeric Augustin
It wasn't documented and it wasn't used anywhere, except in a few tests that don't test it specifically and can be rewritten with get_template.
2014-12-28Supported multiple template engines in get_template and select_template.Aymeric Augustin
This commit changes the return type of these two functions. Instead of returning a django.template.Template they return a backend-specific Template class that must implement render(self, context).
2014-12-28Renamed get_template_from_string to from_string.Aymeric Augustin
The shorter name is just as explicit and, well, shorter.
2014-11-23Moved make_origin into the Engine class.Aymeric Augustin
2014-11-23Moved template loaders management in Engine.Aymeric Augustin
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-23Introduced a template engine class.Aymeric Augustin
Moved Django templates loading infrastructure there.
2014-11-23Deprecated dirs argument to override TEMPLATE_DIRS.Aymeric Augustin
Cancels 2f0566fa. Refs #4278.
2014-11-22Avoided rewrapping Contexts in render_to_response.Aymeric Augustin
This change preserves backwards-compatibility for a very common misuse of render_to_response which even occurred in the official documentation. It fixes that misuse wherever it happened in the code base and docs. Context.__init__ is documented as accepting a dict and nothing else. Since Context is dict-like, Context(Context({})) could work to some extent. However, things get complicated with RequestContext and that gets in the way of refactoring the template engine. This is the real rationale for this change.
2014-11-16Refactored getting the list of template loaders.Aymeric Augustin
This provides the opportunity to move utility functions specific to the Django Template Language outside of django.template.loader.
2014-11-16Deprecated function-based loaders.Aymeric Augustin
2014-11-16Removed obsolete comment.Aymeric Augustin
It didn't account for class-based template loaders.
2014-11-16Moved all template loaders under django.template.loaders.Aymeric Augustin
Reformatted the code of base.Loader according to modern standards. Turned the test template loader into a regular locmem.Loader -- but didn't document it. Added a normal deprecation path for BaseLoader which is a public API. Added an accelerated deprecation path for TestTemplateLoader which is a private API.
2014-09-05Limited lines to 119 characters in django/Tim Graham
refs #23395.
2014-02-22Fixed #21741 -- Fixed render_to_string to stop pushing empty dictionaries to ↵Baptiste Mispelon
its Context Thanks to kezabelle for the report and original patch and to numerodix for his improved patch.
2014-02-08Fixed #21674 -- Deprecated the import_by_path() function in favor of ↵Berker Peksag
import_string(). Thanks Aymeric Augustin for the suggestion and review.
2014-01-19Moved the loader tags registration with the other builtins.Baptiste Mispelon
2013-11-02Fixed the remaining E302 violations int eh django packageAlex Gaynor
2013-09-18Fixed #4278 -- Added a dirs parameter to a few functions to override ↵Berker Peksag
TEMPLATE_DIRS. * django.template.loader.get_template() * django.template.loader.select_template() * django.shortcuts.render() * django.shortcuts.render_to_response() Thanks amcnabb for the suggestion.
2013-09-10Fixed #20841 -- Added messages to NotImplementedErrorsGregor MacGregor
Thanks joseph at vertstudios.com for the suggestion.
2013-07-17Allowed Context.push to behave as a context mananger.Curtis Maloney
Thanks Loic Bistuer for the review.
2013-02-04Fixed #17061 -- Factored out importing object from a dotted pathClaude Paroz
Thanks Carl Meyer for the report.
2012-07-22[py3] Replaced basestring by six.string_types.Aymeric Augustin
2012-04-29Fixed #18013 -- Use the new 'as' syntax for exceptions.Claude Paroz
Thanks Clueless for the initial patch. Note that unittest has been purposely left out (external package only used by Python 2.6).
2011-09-21Fixed #16866 -- Clearer error message if empty list is passed to ↵Carl Meyer
select_template. Thanks Silver_Ghost for report and patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16861 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-04-02Advanced deprecations in django.template.Russell Keith-Magee
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15985 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-03Fixed #15502 -- Ensure that nested TemplateDoesNotExist errors are ↵Russell Keith-Magee
propegated with a meaningful error message when loaded using select_template. Thanks to jaylett for the report, and GDorn for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15717 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-03Fixed #15530 -- Corrected typo in template loader deprecation message. ↵Russell Keith-Magee
Thanks to msaelices for the report and patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15714 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-02-20Ensure render_to_string leaves the context instance stack in the state it ↵Chris Beaven
was originally passed in. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15591 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-27Fixed #12248 -- Refactored django.template to get code out of __init__.py, ↵Russell Keith-Magee
to help with avoiding circular import dependencies. Thanks to Tom Tobin for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14722 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-11Fixed #14436 -- Escalated 1.2 PendingDeprecationWarnings to ↵Russell Keith-Magee
DeprecationWarnings, and removed 1.1 deprecated code. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14138 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-03-18Fixed #13123 -- Cleaned up template loader for PyPy compatibility. Thanks to ↵Russell Keith-Magee
avostryakov for the report. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12805 bcc190cf-cafb-0310-a4f2-bffc1f526a37