title: Displaying a list of table entries in Django
body: <p>I have a database table that allows you to enter details about a particular person. How can i then list all the entries of that table to show all the people added to the database.</p>
  
  <p>urls.py</p>
  
  <pre><code>url(r'^accounts/loggedin/locations/all/$', 'assessments.views.locations'),
  url(r'^accounts/loggedin/locations/get/(?P&lt;location_id&gt;\d+)$',   'assessments.views.location'),
  url(r'^accounts/loggedin/locations/create/$', 'assessments.views.create'),
  </code></pre>
  
  <p>models.py</p>
  
  <pre><code>class People(models.Model):
      first_name = models.CharField(max_length=30)
      last_name = models.CharField(max_length=30)
  </code></pre>
  
  <p>view.py</p>
  
  <pre><code>def people(request):
      return render_to_response('dashboard/people.html', {'people': People.objects.all})
  </code></pre>
  
  <p>people.html</p>
  
  <pre><code>&lt;body&gt;
      &lt;h1&gt;People&lt;/h1&gt;
      {% for p in people %}
      &lt;h1&gt;&lt;a href="/people/get/{{ people.id }}/"&gt;{{ people.first_name }}&lt;/a&gt;&lt;/h1&gt;
      {% endfor %}
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>