diff options
| -rw-r--r-- | debug_toolbar/settings.py | 11 | ||||
| -rw-r--r-- | debug_toolbar/utils.py | 7 | ||||
| -rw-r--r-- | docs/configuration.rst | 15 | ||||
| -rw-r--r-- | tests/__init__.py | 1 | 
4 files changed, 13 insertions, 21 deletions
| diff --git a/debug_toolbar/settings.py b/debug_toolbar/settings.py index 6d21c34..5a58b6b 100644 --- a/debug_toolbar/settings.py +++ b/debug_toolbar/settings.py @@ -24,12 +24,12 @@ CONFIG_DEFAULTS = {      # Panel options      'EXTRA_SIGNALS': [],      'ENABLE_STACKTRACES': True, -    'HIDE_DJANGO_SQL': True,      'HIDE_IN_STACKTRACES': (          'socketserver' if six.PY3 else 'SocketServer',          'threading',          'wsgiref',          'debug_toolbar', +        'django',      ),      'INTERCEPT_REDIRECTS': False,      'SHOW_TEMPLATE_CONTEXT': True, @@ -50,11 +50,16 @@ for old_name, new_name in _RENAMED_CONFIG.items():              "%r was renamed to %r. Update your DEBUG_TOOLBAR_CONFIG "              "setting." % (old_name, new_name), DeprecationWarning)          USER_CONFIG[new_name] = USER_CONFIG.pop(old_name) +if 'HIDE_DJANGO_SQL' in USER_CONFIG: +    warnings.warn( +        "HIDE_DJANGO_SQL was removed. Update your " +        "DEBUG_TOOLBAR_CONFIG setting.", DeprecationWarning) +    USER_CONFIG.pop('HIDE_DJANGO_SQL')  if 'TAG' in USER_CONFIG: -     warnings.warn( +    warnings.warn(          "TAG was replaced by INSERT_BEFORE. Update your "          "DEBUG_TOOLBAR_CONFIG setting.", DeprecationWarning) -     USER_CONFIG['INSERT_BEFORE'] = '</%s>' % USER_CONFIG.pop('TAG') +    USER_CONFIG['INSERT_BEFORE'] = '</%s>' % USER_CONFIG.pop('TAG')  CONFIG.update(USER_CONFIG) diff --git a/debug_toolbar/utils.py b/debug_toolbar/utils.py index 065c810..d84c79c 100644 --- a/debug_toolbar/utils.py +++ b/debug_toolbar/utils.py @@ -54,12 +54,7 @@ def tidy_stacktrace(stack):      """      trace = []      for frame, path, line_no, func_name, text in (f[:5] for f in stack): -        s_path = os.path.realpath(path) -        # Support hiding of frames -- used in various utilities that provide -        # inspection. -        if CONFIG['HIDE_DJANGO_SQL'] and django_path in s_path and not 'django/contrib' in s_path: -            continue -        if omit_path(s_path): +        if omit_path(os.path.realpath(path)):              continue          text = (''.join(force_text(t) for t in text)).strip() if text else ''          trace.append((path, line_no, func_name, text)) diff --git a/docs/configuration.rst b/docs/configuration.rst index eebb6e9..a276aa3 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -117,20 +117,11 @@ Panel options    calls. Enabling stacktraces can increase the CPU time used when executing    queries. -* ``HIDE_DJANGO_SQL`` - -  Default: ``True`` - -  Panels: cache, SQL - -  If set to ``True`` then code in Django itself won't be shown in -  stacktraces. -  * ``HIDE_IN_STACKTRACES`` -  Default: ``('socketserver', 'threading', 'wsgiref', 'debug_toolbar')``. The -  first value is ``socketserver`` on Python 3 and ``SocketServer`` on Python -  2. +  Default: ``('socketserver', 'threading', 'wsgiref', 'debug_toolbar', +  'django')``. The first value is ``socketserver`` on Python 3 and +  ``SocketServer`` on Python 2.    Panels: cache, SQL diff --git a/tests/__init__.py b/tests/__init__.py index f41162b..0681f90 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -15,6 +15,7 @@ def update_toolbar_config(**kwargs):          dt_settings.CONFIG.update(kwargs['value'] or {})          # This doesn't account for deprecated configuration options. +  @receiver(setting_changed)  def update_toolbar_panels(**kwargs):      if kwargs['setting'] == 'DEBUG_TOOLBAR_PANELS': | 
