aboutsummaryrefslogtreecommitdiffstats
path: root/debug_toolbar/utils/tracking/db.py
diff options
context:
space:
mode:
authorColin Howe2011-10-07 08:09:31 +0100
committerColin Howe2011-10-07 08:09:31 +0100
commit295f6f8f9a269cc547054f7094473b4388d58b16 (patch)
tree726004a7b3528fecc83b86344e7c21d5e2ce6c7b /debug_toolbar/utils/tracking/db.py
parent9067568b0bbf0c39322f5b761b05463685355b4f (diff)
downloaddjango-debug-toolbar-295f6f8f9a269cc547054f7094473b4388d58b16.tar.bz2
Make stacktraces configurable
Diffstat (limited to 'debug_toolbar/utils/tracking/db.py')
-rw-r--r--debug_toolbar/utils/tracking/db.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/debug_toolbar/utils/tracking/db.py b/debug_toolbar/utils/tracking/db.py
index 97a9241..c808a7f 100644
--- a/debug_toolbar/utils/tracking/db.py
+++ b/debug_toolbar/utils/tracking/db.py
@@ -71,7 +71,12 @@ class NormalCursorWrapper(object):
finally:
stop = datetime.now()
duration = ms_from_timedelta(stop - start)
- stacktrace = tidy_stacktrace(reversed(inspect.stack()))
+ enable_stacktraces = getattr(settings, 'DEBUG_TOOLBAR_CONFIG', {}) \
+ .get('ENABLE_STACKTRACES', True)
+ if enable_stacktraces:
+ stacktrace = tidy_stacktrace(reversed(inspect.stack()))
+ else:
+ stacktrace = []
_params = ''
try:
_params = simplejson.dumps([force_unicode(x, strings_only=True) for x in params])