diff --git a/debug_toolbar/panels/templates/panel.py b/debug_toolbar/panels/templates/panel.py index 72565f016..17175ed03 100644 --- a/debug_toolbar/panels/templates/panel.py +++ b/debug_toolbar/panels/templates/panel.py @@ -96,10 +96,13 @@ def _store_template_info(self, sender, **kwargs): if pformatted is None: temp_layer = {} for key, value in context_layer.items(): + # Do not force evaluating LazyObject + if hasattr(value, "_wrapped"): + temp_layer[key] = repr(value) # Replace any request elements - they have a large # Unicode representation and the request data is # already made available from the Request panel. - if isinstance(value, http.HttpRequest): + elif isinstance(value, http.HttpRequest): temp_layer[key] = "<>" # Replace the debugging sql_queries element. The SQL # data is already made available from the SQL panel.