title: Django: How to display author of query of posts?
body: <p>I'm trying to make individual pages for each author showing their name and posts. I can't seem to get the username displayed.</p>
  
  <p>views.py</p>
  
  <pre><code>class UserProfileView(generic.ListView):
      template_name = 'howl/user-profile.html'
      context_object_name = 'user_howls'
  
      def get_queryset(self):
          author = self.request.user
          u = User.objects.get(username=author)
          return Howl.objects.filter(author=u)
  </code></pre>
  
  <p>models.py</p>
  
  <pre><code>class Howl(models.Model):
      author = models.ForeignKey(User, null=True)
      content = models.CharField(max_length=150)
  </code></pre>
  
  <p>Here is where I'm stuck.</p>
  
  <p>user-profile.html</p>
  
  <pre><code>{% extends 'howl/base.html' %}
  
  {% block content %}
  
  &lt;h1&gt;User: {{user_howl.author}}&lt;/h1&gt;
  
  {% for user_howl in user_howls %}
  &lt;ul&gt;
      &lt;li&gt;{{user_howl.content}}&lt;/li&gt;
  &lt;/ul&gt;
  {% endfor %}
  
  {% endblock %}
  </code></pre>
  
  <p>The content is displayed just fine, but the heading just says "User: ", how do I give it a context without using a for loop?
  I've tried:</p>
  
  <pre><code>{% for author in user_howls.author %}
  &lt;h1&gt;User: {{author}}&lt;/h1&gt;
  {% endfor %}
  </code></pre>
  
  <p>and </p>
  
  <pre><code>{% if user_howls.author %}
  &lt;h1&gt;User: {{user_howl.author}}&lt;/h1&gt;
  {% endif %}
  </code></pre>
  
  <p>Still the same outcome, displaying "User: "</p>