title: Django view not updating after changes in model
body: <p>I am running into a problem with a Django project I am currently working on.</p>
  
  <p>I have a view in which I create a model instance via a POST request:</p>
  
  <pre><code>class CreatePollView(View):
      template = "polls/create_poll.html"
  
      @method_decorator(login_required)
      def post(self, request):
          question_text = request.POST['question']
          pub_date = now()
          new_question = Question(question_text=question_text, pub_date=pub_date)
          new_question.save()
  
          options_list = request.POST.getlist('options')
          for option in options_list:
              option_text = option
              new_option = Option(option_text=option_text, question=new_question)
              new_option.save()
  
          return HttpResponseRedirect(reverse('polls:detail', args=(new_question.id,)))
  </code></pre>
  
  <p>This works fine. I can add the question and its options to the DB and see that it has been added in the admin. But when I then call my index.html, in which I list all the question objects, it doesn't update.</p>
  
  <pre><code>class IndexView(View):
      template = loader.get_template('polls/index.html')
      questions = Question.objects.all()
      context = {
          'question_list': questions,
      }
  
      def get(self, request):
          return HttpResponse(self.template.render(self.context, request))
  </code></pre>
  
  <p>And the template:</p>
  
  <pre><code>{% extends 'homepage/base.html' %}
  {% block content %}
      &lt;div class="row"&gt;
          &lt;div class="col-md-6 col-md-offset-3"&gt;
              &lt;h1&gt;All Polls:&lt;/h1&gt;
              &lt;div&gt;
                  {% for question in question_list %}
                      &lt;p&gt;&lt;a href="{{ question.pk }}"&gt;{{ question }}&lt;/a&gt;&lt;/p&gt;
  
                  {% endfor %}
                  &lt;a href="new_poll" class="btn btn-primary"&gt;New Poll&lt;/a&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  {% endblock %}
  </code></pre>
  
  <p>When I build an error into the view, then fix it and run the code again it updates the list. <code>Question.objects.all()</code></p>
  
  <p>But other than that the model changes are not displayed here when I post a new model instance. Can someone tell me what I am doing wrong?</p>
  
  <p>EDIT: This only seems to happen with class based views. When I was using method views it worked fine.</p>
  
  <pre><code>def index(request):
      question_list = Question.objects.all()
      template = loader.get_template('polls/index.html')
      context = {
          'question_list': question_list,
      }
      return HttpResponse(template.render(context, request))
  
  
  def new_poll(request):
      if request.method == 'POST':
          question_text = request.POST['question']
          pub_date = now()
          new_question = Question(question_text=question_text, pub_date=pub_date)
          new_question.save()
  
          options_list = request.POST.getlist('options')
          # import pdb
          # pdb.set_trace()
          for option in options_list:
              option_text = option
              new_option = Option(option_text=option_text, question=new_question)
              new_option.save()
  
          return HttpResponseRedirect(reverse('polls:detail', args=(new_question.id,)))
      else:
          template = loader.get_template('polls/create_poll.html')
          context = {
              'user': request.user
          }
          return HttpResponse(template.render(context, request))
  </code></pre>