def redirect(self, uri, request, type='found'):
        if 'format' in request.REQUEST:
            uri = urlparse(uri)
            args = []
            for k, vs in parse_qs(uri.query, keep_blank_values=True).items():
                if k == 'format':
                    continue
                else:
                    for v in vs:
                        args.append((k, v))
            if (uri.netloc != request.META.get('HTTP_HOST') and \
                uri.netloc != '') or type == 'secure':
                # This makes sure we never cross http/https boundaries with AJAX
                # requests or try to make an off-site AJAX request
                uri = urlunparse((uri.scheme, uri.netloc, uri.path, uri.params,
                                  urlencode(args), uri.fragment))
                return self.render(request, {'redirect': uri}, None)
            args.append(('format', request.REQUEST['format']))
            uri = urlunparse((uri.scheme, uri.netloc, uri.path, uri.params,
                              urlencode(args), uri.fragment))
        
        redirect = {
            'found': HttpResponseRedirect,
            'perm': HttpResponsePermanentRedirect,   
            'secure': HttpResponsePermanentRedirect,
            'seeother': HttpResponseSeeOther,
        }.get(type)
        return redirect(uri)
When called, returns a response which redirects users to the correct
dataset/ETHPy150Open mollyproject/mollyproject/molly/utils/views.py/BaseView.redirect