Like, have them logged to the console?
+3
A:
I usually use http://github.com/robhudson/django-debug-toolbar where it tells you the queries and how long they actually take to execute.
Meitham
2010-09-16 14:21:44
A:
Certainly. From the command line/shell:
queryset = Model.objects.filter()
print queryset.query
Variant 2:
from django.db import connection
queryset = Model.objects.filter()
queryset[0] # This variant needs the queryset to be accessed. Hence.
print connection.queries
If you want to print the queries used to render a page then you can use the toolbar as @Meitham suggested or use this Django snippet.
Manoj Govindan
2010-09-16 15:38:27