Module Import alias Import alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ClassDef bases NameLoad body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Str FunctionDef arguments args NameParam defaults vararg kwarg body If AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Dict Str Str Dict Dict Assign AttributeStore NameLoad attr ListComp AttributeLoad NameLoad attr comprehension NameStore Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call NameLoad Expr Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr keyword TupleLoad Str keyword Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr keyword TupleLoad Str keyword Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr keyword TupleLoad Str keyword Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr keyword Str Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Str Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr Dict Str Str Dict Dict For NameStore AttributeLoad NameLoad attr body Assign SubscriptStore SubscriptLoad AttributeLoad NameLoad attr Index Str Index NameLoad Dict Str Str Str Num Num Num Assign SubscriptStore SubscriptLoad AttributeLoad NameLoad attr Index Str Index NameLoad Dict Str Str Str Num Num Num Assign AttributeStore NameLoad attr Call NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body For NameStore Call AttributeLoad NameLoad attr body For NameStore AttributeLoad NameLoad attr body If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad body If CompareIsNot Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad NameLoad Index Str NameLoad body AugAssignAdd SubscriptStore SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Index AttributeLoad NameLoad attr Index Str Num orelse AugAssignAdd SubscriptStore SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Index AttributeLoad NameLoad attr Index Str Num AugAssignAdd SubscriptStore SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Index AttributeLoad NameLoad attr Index Str Num AugAssignAdd SubscriptStore AttributeLoad NameLoad attr Index SubscriptLoad NameLoad Index Str Num Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Num If NameLoad body Assign TupleStore NameStore NameStore SubscriptLoad NameLoad Index Num Assign SubscriptStore SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Index AttributeLoad NameLoad attr Index Str NameLoad orelse Assign SubscriptStore SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Index AttributeLoad NameLoad attr Index Str Num decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call NameLoad ListComp Call AttributeLoad NameLoad attr NameLoad NameLoad comprehension NameStore SubscriptLoad NameLoad Index Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call NameLoad ListComp Call AttributeLoad NameLoad attr NameLoad SubscriptLoad NameLoad Index Str comprehension NameStore SubscriptLoad NameLoad Index Str decorator_list FunctionDef arguments args NameParam NameParam defaults body If BoolOpAnd AttributeLoad NameLoad attr UnaryOpNot Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body If BoolOpAnd AttributeLoad NameLoad attr UnaryOpNot Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Str NameLoad body If CompareIs NameLoad NameLoad body If AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad Str attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr orelse Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad AugAssignAdd NameStore Str AugAssignAdd NameStore Str AugAssignAdd NameStore Str For TupleStore NameStore NameStore Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad attr body If CompareGt SubscriptLoad NameLoad Index Str Num body Assign NameStore Call AttributeLoad Str attr keyword Call AttributeLoad SubscriptLoad Call AttributeLoad NameLoad attr Slice Num attr Num keyword Call AttributeLoad NameLoad attr Num keyword Call AttributeLoad Call NameLoad SubscriptLoad NameLoad Index Str attr Num keyword Call AttributeLoad Call NameLoad SubscriptLoad NameLoad Index Str attr Num keyword Call AttributeLoad Call NameLoad SubscriptLoad NameLoad Index Str attr Num keyword Call AttributeLoad Call NameLoad SubscriptLoad NameLoad Index Str attr Num AugAssignAdd NameStore Call AttributeLoad NameLoad attr NameLoad SubscriptLoad NameLoad Index Str AugAssignAdd NameStore Str Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If SubscriptLoad NameLoad Index Str body For TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad NameLoad Index Str body Assign NameStore ListLoad Call AttributeLoad Str attr NameLoad AugAssignAdd NameStore Call NameLoad NameLoad Assign NameStore BinOpAdd Call AttributeLoad Str attr NameLoad Str AugAssignAdd NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Num Assign NameStore Num For TupleStore NameStore NameStore Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad attr body AugAssignAdd NameStore SubscriptLoad NameLoad Index Str AugAssignAdd NameStore SubscriptLoad NameLoad Index Str Return TupleLoad NameLoad NameLoad BinOpAdd NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body If CompareGt NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Str body Assign NameStore Call AttributeLoad NameLoad attr NameLoad orelse If CompareGt NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Str body Assign NameStore Call AttributeLoad NameLoad attr NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Str keyword NameLoad If BoolOpAnd AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Assign NameStore BinOpSub AttributeLoad NameLoad attr AttributeLoad NameLoad attr orelse Assign NameStore Num Assign NameStore BinOpAdd SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num Assign NameStore Call AttributeLoad Str attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad If BoolOpAnd CompareGtE NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Str CompareGtE NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Str body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list decorator_list
N/A N/A re N/A sys N/A timeit collections Counter textwrap wrap django.conf settings django.db connections django.utils termcolors qc_settings QC_SETTINGS QueryCountMiddleware N/A object N/A N/A This middleware prints the number of database queries for each http
    request and response. This code is adapted from: http://goo.gl/UUKN0r N/A READ_QUERY_REGEX N/A N/A re compile SELECT .* __init__ N/A N/A self N/A args kwargs N/A N/A N/A settings DEBUG N/A N/A N/A self request_path None N/A N/A self stats N/A request response N/A N/A N/A N/A self dbs N/A N/A c alias N/A c N/A N/A connections all N/A N/A self queries N/A Counter N/A N/A N/A self _reset_stats N/A N/A self _start_time None N/A N/A self _end_time None N/A N/A self host None N/A N/A self white N/A N/A termcolors make_style opts N/A bold fg white N/A N/A self red N/A N/A termcolors make_style opts N/A bold fg red N/A N/A self yellow N/A N/A termcolors make_style opts N/A bold fg yellow N/A N/A self green N/A N/A termcolors make_style fg green N/A N/A self threshold N/A QC_SETTINGS N/A THRESHOLDS N/A N/A N/A N/A super QueryCountMiddleware self __init__ args kwargs N/A _reset_stats N/A N/A self N/A N/A N/A N/A self stats N/A request response N/A N/A N/A alias N/A self dbs N/A N/A N/A N/A N/A self stats N/A request N/A alias N/A writes reads total 0 0 0 N/A N/A N/A N/A self stats N/A response N/A alias N/A writes reads total 0 0 0 N/A N/A self queries N/A Counter N/A _count_queries N/A N/A self which N/A N/A N/A c N/A N/A connections all N/A N/A q N/A c queries N/A N/A N/A N/A N/A self _ignore_sql q N/A N/A N/A N/A N/A N/A self READ_QUERY_REGEX search N/A q N/A sql None N/A N/A N/A N/A N/A N/A self stats N/A which N/A N/A c alias N/A reads 1 N/A N/A N/A N/A N/A N/A self stats N/A which N/A N/A c alias N/A writes 1 N/A N/A N/A N/A N/A self stats N/A which N/A N/A c alias N/A total 1 N/A N/A N/A self queries N/A N/A q N/A sql 1 N/A duplicates N/A N/A N/A self queries most_common 1 N/A duplicates N/A N/A N/A sql count N/A duplicates N/A 0 N/A N/A N/A N/A N/A self stats N/A which N/A N/A c alias N/A duplicates count N/A N/A N/A N/A N/A N/A self stats N/A which N/A N/A c alias N/A duplicates 0 N/A _ignore_request N/A N/A self path N/A N/A N/A Check to see if we should ignore the request. N/A N/A any N/A N/A N/A re match pattern path N/A pattern N/A QC_SETTINGS N/A IGNORE_REQUEST_PATTERNS N/A _ignore_sql N/A N/A self query N/A N/A N/A Check to see if we should ignore the sql query. N/A N/A any N/A N/A N/A re search pattern N/A query N/A sql N/A pattern N/A QC_SETTINGS N/A IGNORE_SQL_PATTERNS N/A process_request N/A N/A self request N/A N/A N/A N/A N/A settings DEBUG N/A N/A N/A self _ignore_request N/A request path N/A N/A N/A self host N/A N/A N/A request META get HTTP_HOST None N/A N/A self request_path N/A request path N/A N/A self _start_time N/A N/A timeit default_timer N/A N/A N/A self _count_queries request N/A process_response N/A N/A self request response N/A N/A N/A N/A N/A settings DEBUG N/A N/A N/A self _ignore_request N/A request path N/A N/A N/A self request_path N/A request path N/A N/A self _end_time N/A N/A timeit default_timer N/A N/A N/A self _count_queries response N/A N/A N/A self print_num_queries N/A N/A N/A self _reset_stats N/A response N/A _stats_table N/A N/A self which path output N/A None N/A N/A N/A output None N/A N/A N/A self host N/A N/A host_string N/A N/A http://{0}{1} format N/A self host N/A self request_path N/A N/A host_string N/A self request_path N/A output N/A N/A self white N/A N/A 
{0}
 format host_string N/A output |------|-----------|----------|----------|----------|------------|
 N/A output | Type | Database  |   Reads  |  Writes  |  Totals  | Duplicates |
 N/A output |------|-----------|----------|----------|----------|------------|
 N/A N/A db stats N/A N/A N/A N/A self stats N/A which items N/A N/A N/A N/A stats N/A total 0 N/A N/A line N/A N/A |{w}|{db}|{reads}|{writes}|{total}|{duplicates}|
 format w N/A N/A N/A N/A N/A which upper N/A 4 center 6 db N/A N/A db center 11 reads N/A N/A N/A str N/A stats N/A reads center 10 writes N/A N/A N/A str N/A stats N/A writes center 10 total N/A N/A N/A str N/A stats N/A total center 10 duplicates N/A N/A N/A str N/A stats N/A duplicates center 12 N/A output N/A N/A self _colorize line N/A stats N/A total N/A output |------|-----------|----------|----------|----------|------------|
 N/A output N/A _duplicate_queries N/A N/A self output N/A N/A N/A Appends the most common duplicate queries to the given output. N/A N/A QC_SETTINGS N/A DISPLAY_DUPLICATES N/A N/A N/A query count N/A N/A N/A self queries most_common N/A QC_SETTINGS N/A DISPLAY_DUPLICATES N/A N/A lines N/A N/A N/A 
Repeated {0} times. format count N/A lines N/A wrap query N/A lines N/A N/A N/A join lines N/A output N/A N/A self _colorize lines count N/A output N/A _totals N/A N/A self which N/A N/A N/A reads 0 N/A writes 0 N/A N/A db stats N/A N/A N/A N/A self stats N/A which items N/A N/A reads N/A stats N/A reads N/A writes N/A stats N/A writes N/A N/A reads writes N/A reads writes N/A _colorize N/A N/A self output metric N/A N/A N/A N/A metric N/A N/A self threshold N/A HIGH N/A N/A output N/A N/A self red output N/A N/A N/A metric N/A N/A self threshold N/A MEDIUM N/A N/A output N/A N/A self yellow output N/A N/A output N/A N/A self green output N/A output N/A print_num_queries N/A N/A self N/A N/A N/A request_totals N/A N/A self _totals request N/A output N/A N/A self _stats_table request N/A response_totals N/A N/A self _totals response N/A output N/A N/A self _stats_table response output output N/A N/A N/A self _end_time N/A self _start_time N/A N/A elapsed N/A N/A self _end_time N/A self _start_time N/A N/A elapsed 0 N/A count N/A N/A request_totals N/A 2 N/A response_totals N/A 2 N/A sum_output N/A N/A Total queries: {0} in {1:.4f}s 

 format count elapsed N/A sum_output N/A N/A self _colorize sum_output count N/A sum_output N/A N/A self _duplicate_queries sum_output N/A N/A N/A elapsed N/A N/A self threshold N/A MIN_TIME_TO_LOG N/A count N/A N/A self threshold N/A MIN_QUERY_COUNT_TO_LOG N/A N/A N/A N/A N/A sys stderr write output N/A N/A N/A N/A sys stderr write sum_output N/A N/A