Yes, I think you are right, I suspected that but I tried in middleware too but its still empty.
On Mar 9, 3:55 pm, Ivan Sagalaev <[EMAIL PROTECTED]> wrote: > Iapain wrote: > > Hello, > > > I am writing a SQL logviewer for sql queries fired by django. If I use > > below code then i get an empty list of dictionary. > > > from django.db import conneciton > > from django.conf import settings > > debug = settings.DEBUG #btw its always True, because i set it to true > > in my settings.py > > settings.DEBUG = True > > print str(connection.queries) > > Where is this code located? A common error is to place such logs in a > view before rendering a response while many queries happen during > response generation from templates. > > Your best bet is to put this logic in a response middleware and place it > last. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---

