title: django middleware redirect infinite loop
body: <p>I have a middleware that checks a session value and redirects depending that value.  My problem is, it is creating an infinite redirect loop and I'm not sure why. </p>
  
  <p>So, what I want to do is check to see if the value of the session visible is yes and if not redirect the user to my test view.  </p>
  
  <p>Here is my middleware:</p>
  
  <pre><code>class CheckStatus(object):  
  
      def process_request(self, request):    
          if request.user.is_authenticated():                
  
                  s = request.session.get('visible')
                  if str(s) is not 'yes':
                      return HttpResponseRedirect(reverse("myapp.myview.views.test"))
  </code></pre>