| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
| |
There's absolutely no advantage [and a mild performance hit] to using six.iter*
in these cases.
|
|
|
|
| |
context manager.
|
|
|
|
| |
firstof template tag.
|
|
|
|
| |
auto-escaping behavior.
|
|
|
|
|
|
|
|
|
|
|
| |
InclusionNode.
This change:
* Makes the InclusionNode cache-safe by removing render-time side effects
to its nodelist.
* Ensures the render_context stack is properly scoped and reset by updating
the render call to use Template.render rather than Nodelist.render.
|
|
|
|
|
|
| |
Rendering a Jinja template with self in the context threw an error.
While self is a reserved variable in Jinja, including self in the
context is not an error, so Django should respect that.
|
|
|
|
|
|
|
|
| |
resolving
Added a django.template logger without a default handler. Added
logging if there is an exception while resolving variables in a
template.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
functions escape their input by default.
This may cause some backwards compatibility issues, but may also
resolve security issues in third party projects that fail to heed warnings
in our documentation.
Thanks Markus Holtermann for help with tests and docs.
|
|
|
|
| |
syntax.
|
|
|
|
| |
specific exceptions.
|
|
|
|
| |
traditional parsing.
|
|
|
|
|
| |
4468c08d7 replaced a lot of the old `dict()` comprehensions
with the new style, but missed this one.
|
|
|
|
|
|
|
| |
filesystem loader implementation.
Besides the directories they look in, these two loaders are functionally
the same. This removes unnecessary code duplication between the two.
|
|
|
|
|
|
| |
Context.template.
Explicit is better than implicit.
|
|
|
|
|
|
|
|
| |
rendering.
This opens more possibilities, like accessing context.template.origin.
It also follows the chain of objects instead of following a shortcut.
|
|
|
|
|
| |
If Django is installed in a path that contains non-ASCII characters,
the tag failed with UnicodeDecodeError.
|
|
|
|
|
|
|
| |
UnicodeDecodeError on Python 2.
The function implemented most of upath(), but skipped the check for
strings that are already unicode.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
Explicitly checking for django.template.Template subclasses is
preferrable to duck-typing because both the django.template.Template and
django.template.backends.django.Template have a render() method.
Thanks spectras for the report.
|
|
|
|
|
|
|
| |
This reduces the length of rope RequestContext gives users to hang
themselves with.
Thanks Alex Hill for the report and Tim Graham for the review.
|
|
|
|
|
|
|
|
| |
context processor.
This significantly improves performance on PyPy. The previous
implementation would generate a new class on every single request,
which is relatively slow.
|
| |
|
| |
|
|
|
|
|
|
|
| |
exceptions.
If importing or initializing a template backend fails, attempting to
access this template backend again must raise the same exception.
|
|
|
|
|
|
| |
once.
Thanks Collin Anderson for the report.
|
|
|
|
| |
template loaders.
|
|
|
|
| |
simple_tag().
|
|
|
|
|
|
|
|
|
|
|
|
| |
few APIs.
Specifically in rendering shortcuts, template responses, and class-based
views that return template responses.
Also added a test for render_to_response(status=...) which was missing
from fdbfc980.
Thanks Tim and Carl for the review.
|
| |
|
|
|
|
| |
responses.
|
|
|
|
|
|
|
|
|
|
|
| |
A deprecation path is required because the return type of
django.template.loader.get_template changed during the
multiple template engines refactor.
test_csrf_token_in_404 was incorrect: it tested the case when the
hardcoded template was rendered, and that template doesn't depend on the
CSRF token. This commit makes it test the case when a custom template is
rendered.
|
|
|
|
|
| |
Changed import style to avoid confusion between Django's and Jinja2's
APIs.
|
|
|
|
| |
template tag.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
It's the main entrypoint to the refactored template system.
|
|
|
|
|
|
|
|
|
| |
This is the expected behavior, but given RequestContext's tortuous
implementation, a straightforward use of its API results in the
opposite.
This commits fixes a regression that must have happened at different
points in the multiple templates engine refactor for different features.
|
|
|
|
|
|
|
| |
Django 2.0.
Since this is a private API introduced in Django 1.8, no documentation
is required.
|
| |
|
| |
|
|
|
|
| |
All tests now rely on TEMPLATES.
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
render(_to_response).
|
|
|
|
|
|
|
|
|
|
| |
Previously, when a template was rendered with RequestContext, inclusion
tags were rendered with a plain context, losing additional information
available in the RequestContext.
The (admittedly bizarre) implementation of RequestContext.new() has the
side-effect of not running template context processors, making this
change backwards-compatible.
|
|
|
|
|
|
| |
django.shortcuts.render(_to_response).
*args, **kwargs brought more confusion than concision.
|