Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/django/template/loader.py
Commit message (Collapse)AuthorAgeFilesLines
* Fixed #25466 -- Added backwards compatibility aliases ↵Tim Graham2015-09-301-0/+11
| | | | | | for LoaderOrigin and StringOrigin. Thanks Simon Charette for the DeprecationInstanceCheck class.
* Removed template.loader.BaseLoader per deprecation timeline.Tim Graham2015-09-241-16/+0
|
* Removed dictionary and context_instance parameters for ↵Tim Graham2015-09-241-50/+5
| | | | | | render functions. Per deprecation timeline.
* Removed dirs parameter in template engine methods and ↵Tim Graham2015-09-241-35/+6
| | | | | | related funtions. Per deprecation timeline.
* Removed unreachable codeAndriy Sokolovskiy2015-06-291-1/+0
|
* Renamed RemovedInDjangoXYWarnings for new roadmap.Tim Graham2015-06-241-5/+5
| | | | | Forwardport of ae1d663b7913f6da233c55409c4973248372d302 from stable/1.8.x plus more.
* Moved engine-related exceptions to ↵Preston Timmons2015-05-071-1/+1
| | | | | | | | django.template.exceptions. 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.
* Fixed #24119, #24120 -- Formalized debug integration for ↵Preston Timmons2015-05-071-9/+9
| | | | template backends.
* Fixed #15053 -- Enabled recursive template loading.Preston Timmons2015-04-221-15/+13
|
* Cleaned up the template debug implementation.Preston Timmons2015-03-201-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Sorted imports with isort; refs #23860.Tim Graham2015-02-061-5/+3
|
* Added a request argument to render_to_string.Aymeric Augustin2015-01-071-2/+7
| | | | | | | 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.
* Added comments to remove Engine.render_to_string in ↵Aymeric Augustin2015-01-061-3/+3
| | | | | | | Django 2.0. Since this is a private API introduced in Django 1.8, no documentation is required.
* Supported multiple template engines in render_to_string.Aymeric Augustin2014-12-281-3/+57
| | | | Adjusted its API through a deprecation path according to the DEP.
* Removed private API get_template_from_string.Aymeric Augustin2014-12-281-4/+0
| | | | It wasn't documented and it wasn't used anywhere.
* Removed private API find_template.Aymeric Augustin2014-12-281-4/+0
| | | | | 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.
* Supported multiple template engines in get_template and ↵Aymeric Augustin2014-12-281-6/+62
| | | | | | | | select_template. 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).
* Renamed get_template_from_string to from_string.Aymeric Augustin2014-12-281-1/+1
| | | | The shorter name is just as explicit and, well, shorter.
* Moved make_origin into the Engine class.Aymeric Augustin2014-11-231-8/+0
|
* Moved template loaders management in Engine.Aymeric Augustin2014-11-231-1/+2
| | | | | | | | | | | 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.
* Introduced a template engine class.Aymeric Augustin2014-11-231-95/+15
| | | | Moved Django templates loading infrastructure there.
* Deprecated dirs argument to override TEMPLATE_DIRS.Aymeric Augustin2014-11-231-3/+31
| | | | Cancels 2f0566fa. Refs #4278.
* Avoided rewrapping Contexts in render_to_response.Aymeric Augustin2014-11-221-1/+6
| | | | | | | | | | | | | 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.
* Refactored getting the list of template loaders.Aymeric Augustin2014-11-161-57/+3
| | | | | This provides the opportunity to move utility functions specific to the Django Template Language outside of django.template.loader.
* Deprecated function-based loaders.Aymeric Augustin2014-11-161-0/+6
|
* Removed obsolete comment.Aymeric Augustin2014-11-161-27/+0
| | | | It didn't account for class-based template loaders.
* Moved all template loaders under django.template.loaders.Aymeric Augustin2014-11-161-39/+17
| | | | | | | | | | | | 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.
* Limited lines to 119 characters in django/Tim Graham2014-09-051-2/+9
| | | | refs #23395.
* Fixed #21741 -- Fixed render_to_string to stop pushing ↵Baptiste Mispelon2014-02-221-1/+2
| | | | | | | empty dictionaries to its Context Thanks to kezabelle for the report and original patch and to numerodix for his improved patch.
* Fixed #21674 -- Deprecated the import_by_path() function ↵Berker Peksag2014-02-081-2/+2
| | | | | | in favor of import_string(). Thanks Aymeric Augustin for the suggestion and review.
* Moved the loader tags registration with the other builtins.Baptiste Mispelon2014-01-191-3/+1
|
* Fixed the remaining E302 violations int eh django packageAlex Gaynor2013-11-031-0/+9
|
* Fixed #4278 -- Added a dirs parameter to a few functions ↵Berker Peksag2013-09-181-7/+8
| | | | | | | | | | | to override 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.
* Fixed #20841 -- Added messages to NotImplementedErrorsGregor MacGregor2013-09-101-1/+1
| | | | Thanks joseph at vertstudios.com for the suggestion.
* Allowed Context.push to behave as a context mananger.Curtis Maloney2013-07-171-4/+1
| | | | Thanks Loic Bistuer for the review.
* Fixed #17061 -- Factored out importing object from a ↵Claude Paroz2013-02-041-10/+2
| | | | | | dotted path Thanks Carl Meyer for the report.
* [py3] Replaced basestring by six.string_types.Aymeric Augustin2012-07-221-1/+2
|
* Fixed #18013 -- Use the new 'as' syntax for exceptions.Claude Paroz2012-04-291-3/+3
| | | | | Thanks Clueless for the initial patch. Note that unittest has been purposely left out (external package only used by Python 2.6).
* Fixed #16866 -- Clearer error message if empty list is ↵Carl Meyer2011-09-211-0/+2
| | | | | | passed to 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
* Advanced deprecations in django.template.Russell Keith-Magee2011-04-021-12/+0
| | | | git-svn-id: http://code.djangoproject.com/svn/django/trunk@15985 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #15502 -- Ensure that nested TemplateDoesNotExist ↵Russell Keith-Magee2011-03-031-2/+5
| | | | | | errors are 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
* Fixed #15530 -- Corrected typo in template loader ↵Russell Keith-Magee2011-03-031-2/+2
| | | | | | deprecation message. Thanks to msaelices for the report and patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15714 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Ensure render_to_string leaves the context instance ↵Chris Beaven2011-02-201-5/+9
| | | | | | stack in the state it was originally passed in. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15591 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #12248 -- Refactored django.template to get code ↵Russell Keith-Magee2010-11-271-1/+1
| | | | | | out of __init__.py, 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
* Fixed #14436 -- Escalated 1.2 PendingDeprecationWarnings ↵Russell Keith-Magee2010-10-111-1/+1
| | | | | | to DeprecationWarnings, and removed 1.1 deprecated code. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14138 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #13123 -- Cleaned up template loader for PyPy ↵Russell Keith-Magee2010-03-181-3/+3
| | | | | | compatibility. Thanks to avostryakov for the report. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12805 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #12787: Correctly identify the template that does ↵Karen Tracey2010-03-161-2/+9
| | | | | | not exist when a template being extended includes another template that does not exist. Thanks to trigeek38 for the report. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12792 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #12992: Adjusted the new template loader code so ↵Karen Tracey2010-03-021-4/+10
| | | | | | | | | | that the template file name is correctly reported on the debug page when a template syntax error is raised. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12643 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Changed a whole bunch of places to raise exception ↵Adrian Holovaty2010-01-101-2/+2
| | | | | | instances instead of old-style raising exception classes plus a comma. Good for the future Python 3 conversion git-svn-id: http://code.djangoproject.com/svn/django/trunk@12180 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed a broken ImproperlyConfigured error messageSimon Willison2009-12-201-1/+1
| | | | git-svn-id: http://code.djangoproject.com/svn/django/trunk@11923 bcc190cf-cafb-0310-a4f2-bffc1f526a37