Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Patch django.template.base.Template.render instead of render_to_strin…
…g(). Render often used without render_to_string, and we want to debug render exceptions in such cases. render_to_string calls render, so intercepting both results in duplicate exception message mangling for render_to_string. Patch URLNode.render to check for using a variable name that doesn't exist, which probably means that you forgot to quote the name of the view you wanted to link to with {% url %}. Otherwise it can be hard to work out where on the page the mistake is, without knowing what to look for. Patch URLNode.render to check for using a variable name that points to a view that doesn't exist, and report the variable name and its value as well as the exception details, in case you used the wrong variable name in a {% url %}, or it had a value that you didn't expect. Patch django.db.models.fields.DateTimeField.get_prep_value to report the field name containing the naive datetime, until https://code.djangoproject.com/ticket/19560 gets fixed. Allow templates to output variables with underscores (e.g. __class__) in DEBUG mode only, to help debug weird template problems.
- Loading branch information
Showing
1 changed file
with
99 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters