Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Connection.queries returns empty list

Not sure what's up. DEBUG mode is set to be on, and everything else is working fine:

>>> from django.db import connection
>>> connection.queries
[]

Nothing is added to connection.queries, even when I refresh a page that I know is doing queries..

Background: Using SQLite for the db, Django version 1.3.1, Python 2.7

like image 876
bgcode Avatar asked Apr 26 '26 21:04

bgcode


1 Answers

You wouldn't get an entry in connection.queries in the shell when you refresh a page - that's not how it works. You'll get an entry when you perform a query in the shell.

If you want to see what your page is doing, you can dump connection.queries to the page output, or even better use the Django-debug-toolbar.

like image 159
Daniel Roseman Avatar answered Apr 29 '26 10:04

Daniel Roseman