Loading django/contrib/admin/helpers.py +1 −0 Original line number Diff line number Diff line Loading @@ -121,6 +121,7 @@ class AdminField(object): self.field = form[field] # A django.forms.BoundField instance self.is_first = is_first # Whether this field is first on the line self.is_checkbox = isinstance(self.field.field.widget, forms.CheckboxInput) self.is_readonly = False def label_tag(self): classes = [] Loading django/template/base.py +7 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,7 @@ u'<html></html>' from __future__ import unicode_literals import logging import re import warnings from functools import partial Loading Loading @@ -125,6 +126,8 @@ libraries = {} # global list of libraries to load by default for a new parser builtins = [] logger = logging.getLogger('django.template') class TemplateSyntaxError(Exception): pass Loading Loading @@ -209,6 +212,7 @@ class Template(object): try: if context.template is None: with context.bind_template(self): context.template_name = self.name return self._render(context) else: return self._render(context) Loading Loading @@ -893,6 +897,9 @@ class Variable(object): else: raise except Exception as e: template_name = getattr(context, 'template_name', 'unknown') logger.debug('{} - {}'.format(template_name, e)) if getattr(e, 'silent_variable_failure', False): current = context.template.engine.string_if_invalid else: Loading django/template/context.py +1 −0 Original line number Diff line number Diff line Loading @@ -141,6 +141,7 @@ class Context(BaseContext): self._current_app = current_app self.use_l10n = use_l10n self.use_tz = use_tz self.template_name = "unknown" self.render_context = RenderContext() # Set to the original template -- as opposed to extended or included # templates -- during rendering, see bind_template. Loading docs/releases/1.9.txt +3 −0 Original line number Diff line number Diff line Loading @@ -188,6 +188,9 @@ Templates * Added a :meth:`Context.setdefault() <django.template.Context.setdefault>` method. * A warning will now be logged for missing context variables. These messages will be logged to the :ref:`django.template <django-template-logger>` logger. Requests and Responses ^^^^^^^^^^^^^^^^^^^^^^ Loading docs/topics/logging.txt +10 −0 Original line number Diff line number Diff line Loading @@ -478,6 +478,16 @@ Messages to this logger have the following extra context: * ``request``: The request object that generated the logging message. .. _django-template-logger: ``django.template`` ~~~~~~~~~~~~~~~~~~~ .. versionadded:: 1.9 Log messages related to the rendering of templates. Missing context variables are logged as ``DEBUG`` messages if :setting:`DEBUG` is `True`. .. _django-db-logger: ``django.db.backends`` Loading Loading
django/contrib/admin/helpers.py +1 −0 Original line number Diff line number Diff line Loading @@ -121,6 +121,7 @@ class AdminField(object): self.field = form[field] # A django.forms.BoundField instance self.is_first = is_first # Whether this field is first on the line self.is_checkbox = isinstance(self.field.field.widget, forms.CheckboxInput) self.is_readonly = False def label_tag(self): classes = [] Loading
django/template/base.py +7 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,7 @@ u'<html></html>' from __future__ import unicode_literals import logging import re import warnings from functools import partial Loading Loading @@ -125,6 +126,8 @@ libraries = {} # global list of libraries to load by default for a new parser builtins = [] logger = logging.getLogger('django.template') class TemplateSyntaxError(Exception): pass Loading Loading @@ -209,6 +212,7 @@ class Template(object): try: if context.template is None: with context.bind_template(self): context.template_name = self.name return self._render(context) else: return self._render(context) Loading Loading @@ -893,6 +897,9 @@ class Variable(object): else: raise except Exception as e: template_name = getattr(context, 'template_name', 'unknown') logger.debug('{} - {}'.format(template_name, e)) if getattr(e, 'silent_variable_failure', False): current = context.template.engine.string_if_invalid else: Loading
django/template/context.py +1 −0 Original line number Diff line number Diff line Loading @@ -141,6 +141,7 @@ class Context(BaseContext): self._current_app = current_app self.use_l10n = use_l10n self.use_tz = use_tz self.template_name = "unknown" self.render_context = RenderContext() # Set to the original template -- as opposed to extended or included # templates -- during rendering, see bind_template. Loading
docs/releases/1.9.txt +3 −0 Original line number Diff line number Diff line Loading @@ -188,6 +188,9 @@ Templates * Added a :meth:`Context.setdefault() <django.template.Context.setdefault>` method. * A warning will now be logged for missing context variables. These messages will be logged to the :ref:`django.template <django-template-logger>` logger. Requests and Responses ^^^^^^^^^^^^^^^^^^^^^^ Loading
docs/topics/logging.txt +10 −0 Original line number Diff line number Diff line Loading @@ -478,6 +478,16 @@ Messages to this logger have the following extra context: * ``request``: The request object that generated the logging message. .. _django-template-logger: ``django.template`` ~~~~~~~~~~~~~~~~~~~ .. versionadded:: 1.9 Log messages related to the rendering of templates. Missing context variables are logged as ``DEBUG`` messages if :setting:`DEBUG` is `True`. .. _django-db-logger: ``django.db.backends`` Loading