title: How do I iterate inside a queryset in django template
body: <p>My django view returns a dictionary <code>people</code> with values for all keys in list format.
  The code for the view is:</p>
  <pre><code>class ProjectDetail(View):
      def get(self, request, pk, *args, **kwargs):
          project = Project.objects.get(pk=pk)
          roles = Role.objects.filter(project=pk)
          people = {}
          for role in roles:
              try:
                  people[role] += Person.objects.filter(role=role.pk)
              except KeyError:
                  people[role] = [Person.objects.filter(role=role.pk)]
  
          context = {
              'project': project,
              'people': people
          }
  
          return render(request, 'project_management/project_detail.html', context)
  </code></pre>
  <p>My Models</p>
  <pre><code>class Project(models.Model):
      title = models.CharField(max_length=2000)
      introduction = models.TextField(blank=True)
  
  class Role(models.Model):
      role_name =  models.CharField(max_length=30)
      project = models.ForeignKey(Status, on_delete=models.CASCADE)
  
  class Person(models.Model):
      name = models.CharField(max_length=30, blank=True, null=True)
      role = models.ForeignKey(Role, on_delete=models.CASCADE)
  </code></pre>
  <p>In order to iterate through the dictionary I used:</p>
  <pre><code>{% for designation, persons in people.items %}
  &lt;h5&gt; {{ designation.role_name }} &lt;/h5&gt;
  &lt;ul&gt;
      {% for person in persons %} &lt;!-- My Problem lies here, this loop is not iterating, it's running only once--&gt;
          &lt;li&gt; {{person}} &lt;/li&gt;
      {% endfor %}
  &lt;/ul&gt;
  {% endfor %}
  </code></pre>
  <p>The result I got is:</p>
  <p><a href="https://i.stack.imgur.com/MF4UB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MF4UB.png" alt="enter image description here" /></a></p>
  <p>I want the items inside queryset listed out separately, instead of being shown inside square brackets. How can I make that happen?</p>