title: Django's get_context_data function not working?
body: <p>I'm practicing with Django's Class Based View.</p>
  
  <p>It seems like my overridden get_context_data function is not working properly, but I have no idea what is wrong :(</p>
  
  <p>My code:</p>
  
  <p><strong>urls.py</strong></p>
  
  <pre><code>url(r'^user/(?P&lt;pk&gt;\d+)/posts/$', UserPosts.as_view(), name='user_post'),
  </code></pre>
  
  <p><strong>views.py</strong></p>
  
  <pre><code>class UserPosts(ListView):
      template_name = 'app_blog/user_posts_page.html'
      context_object_name = 'post_list'
  
      def get_queryset(self):
          self.user = get_object_or_404(User, id=self.kwargs['pk'])
          return self.user.post_set.order_by('-id')
      def get_context_data(self, **kwargs):   
          context = super(UserPosts, self).get_context_data(**kwargs)
          context['user'] = self.user
          return context
  </code></pre>
  
  <p><strong>user_post_page.html</strong></p>
  
  <pre><code>{% block content %}
      &lt;div class="main_content"&gt;
          &lt;h2&gt;Welcome to {{user.username}}'s User Post Page!&lt;/he&gt;
          &lt;ul&gt;
          {% for post in post_list %}
              &lt;li&gt;&lt;a href="/blog/post/{{post.id}}/"&gt;{{post.post_title}}&lt;/a&gt;&lt;/li&gt;
          {% endfor %}
          &lt;/ul&gt;
      &lt;/div&gt;
  {% endblock %}
  </code></pre>
  
  <p>The html page correctly displays the user's post_list, BUT the h2 tag displays:</p>
  
  <pre><code>Welcome to 's User Post Page!
  </code></pre>
  
  <p>I'm pretty sure I passed the 'user' variable in the get_context_data function, but the html page does not displa the user.username... Any idea why this is happening :(??</p>
  
  <p>Thanks</p>