| Age | Commit message (Collapse) | Author |
|
Thanks Tomáš Ehrlich for help with the patch.
|
|
|
|
This now works for multiple Django engines and recursive loaders.
Support for non-Django engines is still pending.
Refs #15053.
|
|
There's absolutely no advantage [and a mild performance hit] to using six.iter*
in these cases.
|
|
|
|
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.
|
|
|
|
|
|
|
|
During the autumn DST change, the template engine would fail to convert
the naive representation of now when USE_TZ = True. Passing now in UTC
eliminates the issue.
Thanks mbertheau and tricoder42.
Refs #23714.
|
|
|
|
In addition to ImproperlyConfigured, Engine.get_default() may also raise
ImportError or other exceptions. It's better to catch all exceptions in
places where the default engine isn't strictly required.
|
|
|
|
|
|
comprehension
|
|
|
|
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.
|
|
Also simplified the logic under the assumption that a false-ish object
won't have an exception_reporter_filter attribute.
|
|
This provides the opportunity to move utility functions specific to the
Django Template Language outside of django.template.loader.
|
|
refs #23395.
|
|
This limits large variables and avoids non-utf-8 in the TECHNICAL_500 output.
|
|
Added a class to wrap callable in settings:
* Not to call in the debug page (#21345).
* Not to break the debug page if the callable forbidding to set attributes (#23070).
Thanks @bmispelon for giving me some advice.
|
|
Thanks Keryn Knight for the suggestion.
|
|
raised and DEBUG=True
Thanks GDorn and gox21 for report.
Thanks Tim Graham for idea and review.
|
|
Fixes a regression introduced in 5f24cf9705. Refs #22635.
Thanks A.J. May for spotting the regression.
|
|
|
|
|
|
|
|
|
|
Commit 79558c78 cleaned up the (undocumented) interface of Resolver404
exception, which breaks compatibility with code messing with .args[0]
directly. Revert the cleanup part and simply leave the fix itself.
|
|
|
|
When django.core.urlresolvers.resolve was called from a view, failed
and the exception was propagated and rendered by technical_404_response,
the URL mentioned on the page was the current URL instead of the URL
passed to resolve().
Fixed by using the path attribute from the Resolver404 exception instead
of request.path_info. Also cleaned up the exceptions to use standard
named parameters instead of stuffing a dict in args[0]
|
|
import_string().
Thanks Aymeric Augustin for the suggestion and review.
|
|
The last component of the dotted path to the application module is
consistently referenced as the application "label". For instance it's
AppConfig.label. appname could be confused with AppConfig.name, which is
the full dotted path.
|
|
Thanks to @dmyerscoug for the report and original patch
and to @alasdairnicol for the added tests.
|
|
|
|
Thanks productions@zaziork.co.uk for the review.
|
|
|
|
|
|
|
|
Thanks to crass for the report.
|
|
|
|
many occurrences in the tests/ dir so it can't be removed from setup.cfg yet)
|
|
|
|
Thanks simonpercivall for the report and bmispelon for the review.
|
|
fixes #21058. by jambonrose and ianawilson
|
|
While using USE_L10N, line numbers and IDs were printed as comma (or
locale equivalent) separated values.
Thanks Kronuz for the report and intial patch.
Fixes #20861.
|
|
|
|
Clearer explanation when exception has no message
|
|
|