How to obtain the SQL query from the queryset?

Last updated 4 years, 4 months ago | 1727 views 75     5

Tags:- Django

Using the query method we can print SQL query from the queryset

post = Post.objects.all()

print(post.query)