4👍
✅
qs=Model.objects.all()
qs.query.as_sql()
Should do the job as it is shown here
EDIT:
I just try it and get the same error.
qs=Model.objects.all()
print qs.query
this must give you what you want (:
Source:stackexchange.com