'Return the URL redirect to. Keyword arguments from the
URL pattern match generating the redirect request
are provided as kwargs to this method.'

def get_redirect_url(self, *args, **kwargs):

    if self.url:
        url = (self.url % kwargs)
    elif self.pattern_name:
        try:
            url = reverse(self.pattern_name, args=args, kwargs=kwargs)
        except NoReverseMatch:
            return None
    else:
        return None
    args = self.request.META.get(u'QUERY_STRING', u'')
    if (args and self.query_string):
        url = (u'%s?%s' % (url, args))
    return url
