How to obtain the SQL query from the queryset?

Last updated 3 weeks, 1 day ago | 18 views 75     5

Tags:- Django

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

post = Post.objects.all()

print(post.query)