title: Setting context variable in Django
body: <p>Here is the code I am working with:</p>
  
  <pre><code>class FeedView(LoginRequiredMixin, generic.ListView):
      template_name = "feed/feed_list.html"
      model = Feed
  
  
      def get(self, request, *args, **kwargs):
          response = super(FeedView, self).get(request, *args, **kwargs)
          return response
  
  
      def get_context_data(self, *args, **kwargs):
          context = super(FeedView, self).get_context_data(*args, **kwargs)
          context["feeds"] = Feed.objects.all()
          context["new_feed_form"] = FeedFormSet(queryset = Feed.objects.none())
          context["commentform"] = CommentForm()
  
          return context
  
      def post(self, request, *args, **kwargs):
  
          formset = FeedFormSet(request.POST, request.FILES)
  
          if formset.is_valid():
              forms = formset.save(commit=False) 
              for form in forms:
                  form.name = self.request.user
  
                  form.save()
  
              return redirect("feeds")
          else:
              # THIS WAY 
  
              context = self.get_context_data(*args, **kwargs)
  
              # OR THIS WAY
              # context = {
              #   'feeds' : Feed.objects.all(),
              # }
  
              # context["new_feed_form"] = formset
              return render(request, self.template_name , context)
  </code></pre>
  
  <p>Inside the <code>Post</code> method, when the form is invalid, setting <code>context</code> variable by <code>context = self.get_context_data(*args, **kwargs)</code> gives me the error <code>'FeedView' object has no attribute 'object_list'</code>. However setting them all again (shown below 'OR THIS WAY' in the code) works fine. How do I fix the error while setting the <code>context</code> variable by <code>context = self.get_context_data(*args, **kwargs)</code> ? </p>