diff options
| -rw-r--r-- | debug_toolbar/panels/template.py | 9 | 
1 files changed, 8 insertions, 1 deletions
diff --git a/debug_toolbar/panels/template.py b/debug_toolbar/panels/template.py index 911952f..ad6dd04 100644 --- a/debug_toolbar/panels/template.py +++ b/debug_toolbar/panels/template.py @@ -74,7 +74,14 @@ class TemplateDebugPanel(DebugPanel):              info['template'] = t              # Clean up context for better readability              c = d.get('context', None) -            info['context'] = '\n'.join([pformat(_d) for _d in c.dicts]) +             +            d_list = [] +            for _d in c.dicts: +                try: +                    d_list.append(pformat(d)) +                except UnicodeEncodeError: +                    pass +            info['context'] = '\n'.join(d_list)              template_context.append(info)          context = {              'templates': template_context,  | 
