title: How to update Context processor variables using ajax request, without refreshing page
body: <p>Currently am displaying notifications count on header for new notifications, they have is_read = False, I want to update is_read = True and remove notifications count, Here is what i am doing</p>
  
  <p><strong>context_processor</strong></p>
  
  <pre><code>  def notification(request):
        """Provide the count of unread notifications for an authenticated user."""
        if request.user.is_authenticated():
            notifications = Notification.objects.filter(user=request.user, is_read=False).\
                                order_by('-created')[:5]
        return {'notification_count': len(notifications),
              'notifications': notifications}
        else:
             return {}
  </code></pre>
  
  <p><strong>html template and ajax call</strong></p>
  
  <pre><code>{% if notification_count &gt;= 1 %}
        &lt;a id="notification_menu" data-toggle="dropdown" class="dropdown-toggle" href="#"&gt;
             &lt;i class="ace-icon fa fa-bell icon-animated-bell"&gt;&lt;/i&gt;
             &lt;span class="badge badge-important"&gt;{{ payzaat_notification_count }}&lt;/span&gt;
        &lt;/a&gt;
   {% endif %}
  
  &lt;script type="text/javascript"&gt;
      (function($){
          $('#notification_menu').on("click",function(){
              console.log('clicked');
              $.ajax({
                      type: "GET",
                      url: "{% url 'parent:update_notification' %}",
                      dataType: 'json',
                      success: function(response){
                          return true;
                      },error:function(response){
                          return false;
                      }
                  });
          });
      })(jQuery);
  &lt;/script&gt;
  </code></pre>
  
  <p><strong>update view</strong></p>
  
  <p>class UpdateNotification(FormView):</p>
  
  <pre><code>@method_decorator(parent_required)
  def dispatch(self, request, *args, **kwargs):
      return super(UpdateNotification, self).dispatch(request, *args, **kwargs)
  
  def get(self, request, *args, **kwargs):
      for record in Notification.objects.filter(user=self.request.user, is_read=False):
          record.is_read = True
          record.save()
      return HttpResponse("OKAY")
  </code></pre>
  
  <p>My model got updated, but template still displaying count until i refresh my page</p>