How do I print the query that Python uses to call the database? [duplicate]

How do I print to the terminal the query used by a specific line of python code? see below

notifications = user.get_notifications(max_id=max_id, types=types).order_by('-created')[:count]
Back to Top