{{{
{% include 'admin/app_list.html' with app_list=available_apps %}
}}}
This leads to megabytes of log spam for every admin page visited with the
sidebar on:
{{{
2020-08-07 09:06:49,882 [DEBUG ] (django.template) Exception while
resolving variable 'show_changelinks' in template
'admin/change_list.html'.
Traceback (most recent call last):
File "[python]\lib\site-packages\django\template\base.py", line 829, in
_resolve_lookup
current = current[bit]
File "[python]\lib\site-packages\django\template\context.py", line 83,
in __getitem__
raise KeyError(key)
KeyError: 'show_changelinks'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "[python]\lib\site-packages\django\template\base.py", line 835, in
_resolve_lookup
if isinstance(current, BaseContext) and getattr(type(current), bit):
AttributeError: type object 'RequestContext' has no attribute
'show_changelinks'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "[python]\lib\site-packages\django\template\base.py", line 843, in
_resolve_lookup
current = current[int(bit)]
ValueError: invalid literal for int() with base 10: 'show_changelinks'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "[python]\lib\site-packages\django\template\base.py", line 848, in
_resolve_lookup
raise VariableDoesNotExist("Failed lookup for key "
django.template.base.VariableDoesNotExist: Failed lookup for key
[show_changelinks] in [{'True': True, 'False': False, 'None': None},}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/31865>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by Carlton Gibson):
Hi.
First pass, I'd say this is deliberately leveraging the DTL's behaviour of
allowing context variables to be undefined. I wouldn't be logging these:
`django.template.base.VariableDoesNotExist`, they're expected.
So, again first pass, do you really want your logging turned up that high?
--
Ticket URL: <https://code.djangoproject.com/ticket/31865#comment:1>
Comment (by Tim Graham):
The logging comes from dc5b01ad05e50ccde688c73c2ed3334a956076b0 (if DEBUG
is True).
I haven't looked into the details but I'd suggest accepting this issue.
--
Ticket URL: <https://code.djangoproject.com/ticket/31865#comment:2>
* owner: nobody => Carlton Gibson
* status: new => assigned
* severity: Normal => Release blocker
* easy: 0 => 1
* stage: Unreviewed => Accepted
Comment:
OK, thanks Tim. I still have to set `level=DEBUG` on the `django.template`
logger (or a parent) to see this but it's a simple adjustment to quieten
that down.
PR shortly.
--
Ticket URL: <https://code.djangoproject.com/ticket/31865#comment:3>
* has_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/31865#comment:4>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/31865#comment:5>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"0aeb802cf054cb369646c871b53c93a83c1fa58a" 0aeb802c]:
{{{
#!CommitTicketReference repository=""
revision="0aeb802cf054cb369646c871b53c93a83c1fa58a"
Fixed #31865 -- Adjusted admin nav sidebar template to reduce debug
logging.
Thanks to Mariusz Felisiak for review.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/31865#comment:6>
Comment (by Carlton Gibson <carlton.gibson@…>):
In [changeset:"02b474f2a4675bffee0cc1396a9c4ad22aef3580" 02b474f]:
{{{
#!CommitTicketReference repository=""
revision="02b474f2a4675bffee0cc1396a9c4ad22aef3580"
[3.1.x] Fixed #31865 -- Adjusted admin nav sidebar template to reduce
debug logging.
Thanks to Mariusz Felisiak for review.
Backport of 0aeb802cf054cb369646c871b53c93a83c1fa58a from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/31865#comment:7>