title: Django process_view middleware resulting in 403 forbidden
body: <p>I've written a small bit of middleware that catches if a user is using a temporary password and, if so, redirects them to a page that forces them to create a new password.  My problem is that the page works fine when the user is logged in and NOT using a temp password (i.e. they go to the change password URL manually), but when they ARE using a temp password the redirect from the middleware yields a 403 Forbidden page.</p>
  
  <p>The middleware does one other thing in process_view after the temp password check, but this is the relevant code:</p>
  
  <pre><code>class MyMiddleware( object ):
    def process_view( self, request, view_func, view_args, view_kwargs ):
      if request.user.is_authenticated( ): 
        try:
          if request.user.get_profile( ).using_temp:
            return HttpResponseRedirect( reverse( 'change_password' ) )
          except Object.DoesNotExist:
            pass
          # Not using temp password, let the request process
          return None
  </code></pre>
  
  <p>Note that rendering the template directly could be used, with something like render_to_response, to fix the problem but that will cause the browser's URL to not follow as well as it not being able to really exit the page it renders.</p>