title: How to see queries run by Django ORM?
body: <p>I have <code>DEBUD = True</code> in <code>settings.py</code> file. I have <code>MySQL</code> database configured with django. I have a <code>Course</code> model in <code>courses/models.py</code>. In <code>courses/views.py</code>, I have:</p>
  
  <pre><code>@api_view(['GET'])
  def courses_list(request):
    courses = Course.objects.all()
    serializer = CourseSerializer(courses, many=True)
    return Response(serializer.data)
  </code></pre>
  
  <p>Now, If I make request from Postman to hit this view, I think some query like <code>SELECT * FROM COURSES</code> must be executed. How to see which queries has been executed when I make a request to some backend URL?</p>
  
  <p>I have also tried <code>from django.db import connection</code> as described <a href="https://docs.djangoproject.com/en/3.0/faq/models/#how-can-i-see-the-raw-sql-queries-django-is-running" rel="nofollow noreferrer">here</a>, but got empty array like this:</p>
  
  <pre><code>&gt;&gt;&gt; from django.db import connection
  &gt;&gt;&gt; connection.queries
  []
  </code></pre>
  
  <p>Please, help me achieve what I want to.</p>