code: def redirect(self, request):
          
          url = request.path
          querystring = request.GET.copy()
          if self.logout_key and self.logout_key in request.GET:
              del querystring[self.logout_key]
          if querystring:
              url = '%s?%s' % (url, querystring.urlencode())
          return HttpResponseRedirect(url)
docs: Handle redirects properly.