How to print the SQL Query from Django QuerySet
http://fosshelp.blogspot.in/2015/03/g...
1)
Open django shell
#python manage.py shell
2)
Import the model class
from bla.models import Building
3)
Print the SQL query
print Building.objects.all().query
OR
Building.objects.all().query.__str__()