diff options
| -rw-r--r-- | debug_toolbar/panels/profiling.py | 8 | ||||
| -rw-r--r-- | example/settings.py | 2 | 
2 files changed, 6 insertions, 4 deletions
| diff --git a/debug_toolbar/panels/profiling.py b/debug_toolbar/panels/profiling.py index 623b27a..e57aa97 100644 --- a/debug_toolbar/panels/profiling.py +++ b/debug_toolbar/panels/profiling.py @@ -123,7 +123,8 @@ class FunctionCall(object):          return 16 * self.depth      def line_stats_text(self): -        if self._line_stats_text is None: +        if (self._line_stats_text is None and +               DJ_PROFILE_USE_LINE_PROFILER):              lstats = self.statobj.line_stats              if self.func in lstats.timings:                  out = StringIO() @@ -188,12 +189,13 @@ class ProfilingDebugPanel(DebugPanel):          func.has_subfuncs = False          if func.depth < max_depth:              for subfunc in func.subfuncs(): -                if subfunc.stats[3] >= cum_time or (subfunc.func in self.stats.line_stats.timings): +                if (subfunc.stats[3] >= cum_time or +                   (hasattr(self.stats, 'line_stats') and +                   (subfunc.func in self.stats.line_stats.timings))):                      func.has_subfuncs = True                      self.add_node(func_list, subfunc, max_depth, cum_time=cum_time)      def content(self): -        import ipdb; ipdb.set_trace()          root = FunctionCall(self.stats, self.stats.get_root_func(), depth=0)          func_list = [] diff --git a/example/settings.py b/example/settings.py index a4d8ec4..b2b98ee 100644 --- a/example/settings.py +++ b/example/settings.py @@ -37,7 +37,7 @@ DEBUG_TOOLBAR_PANELS = (      'debug_toolbar.panels.timer.TimerDebugPanel',      'debug_toolbar.panels.settings_vars.SettingsVarsDebugPanel',      'debug_toolbar.panels.headers.HeaderDebugPanel', -#    'debug_toolbar.panels.profiling.ProfilingDebugPanel', +    'debug_toolbar.panels.profiling.ProfilingDebugPanel',      'debug_toolbar.panels.request_vars.RequestVarsDebugPanel',      'debug_toolbar.panels.sql.SQLDebugPanel',      'debug_toolbar.panels.template.TemplateDebugPanel', | 
