(strace)
return trace
Clean up stacktrace and remove all entries that:
    1. Are part of Django (except contrib apps)
    2. Are part of SocketServer (used by Django's dev server)
    3. Are the last entry (which is part of our stacktracing code)
Clean up stacktrace and remove all entries that:
    1. Are part of Django (except contrib apps)
    2. Are part of SocketServer (used by Django's dev server)
    3. Are the last entry (which is part of our stacktracing code)
Clean up stacktrace and remove all entries that : 1 . Are part of Django ( except contrib apps ) 2 . Are part of SocketServer ( used by Django s dev server ) 3 . Are the last entry ( which is part of our stacktracing code )
def tidy_stacktrace(strace):
    """
    Clean up stacktrace and remove all entries that:
    1. Are part of Django (except contrib apps)
    2. Are part of SocketServer (used by Django's dev server)
    3. Are the last entry (which is part of our stacktracing code)
    """
    trace = []
    for s in strace[:-1]:
        s_path = os.path.realpath(s[0])
        if getattr(settings, 'DEBUG_TOOLBAR_CONFIG', {}).get('HIDE_DJANGO_SQL', True) \
            and django_path in s_path and not 'django/contrib' in s_path:
            continue
        if socketserver_path in s_path:
            continue
        trace.append((s[0], s[1], s[2], s[3]))
    return trace
def tidy_stacktrace ( strace ) : trace = [ ] for s in strace [ : - 1 ] : s_path = os . path . realpath ( s [ 0 ] ) if getattr ( settings , 'DEBUG_TOOLBAR_CONFIG' , { } ) . get ( 'HIDE_DJANGO_SQL' , True ) and django_path in s_path and not 'django/contrib' in s_path : continue if socketserver_path in s_path : continue trace . append ( ( s [ 0 ] , s [ 1 ] , s [ 2 ] , s [ 3 ] ) ) return trace