eg. from django.contrib.auth.models import User a = User.objects.all() print a.query 可以得到sql语句 转载于:https://my.oschina.net/u/240562/blog/95795