title: Performing Raw SQL Queries with Django
body: <p>I'm looking for create some <code>SQL queries</code> with Django but I don't have a display result.
  This queries are very important because I would like to configure a research bar used by client.</p>
  
  <p><strong>For example :</strong> </p>
  
  <p>A user wants to search all people in my table which are named 'Dupont' and living in New-York </p>
  
  <p>In my <code>views.py</code>, I have written something like that :</p>
  
  <pre><code>def Test(request) :
  
      cursor = connection.cursor()
      cursor.execute('''SELECT * FROM BirthCertificate_people WHERE `name` = "Dupont" AND `city` = "New-York"''')
      row = cursor.fetchone()
  
      print row
  
      template = loader.get_template('test.html') 
      return HttpResponse(template.render(request))
  </code></pre>
  
  <p>In my template file <code>test.html</code> :</p>
  
  <pre><code>&lt;h2 align="center"&gt; SQL Queries display &lt;/align&gt; &lt;/h2&gt;
  
  {% block content %}
  
  &lt;!-- What I write there --&gt; {{ }}
  
  {% endblock %}
  </code></pre>
  
  <p>I don't know How I can display the SQL queries results in my .html file.</p>
  
  <p>I read some tutorials : <a href="https://docs.djangoproject.com/en/dev/topics/db/sql/" rel="nofollow noreferrer">Django Raw SQL Query</a> but none results for the moment ..</p>
  
  <p>Thank you so much !</p>