'If a redirect_url is specified in the querystring for this request, and the value is a url
with the same host, the view will redirect to this page after rendering the template.
If it is not specified, we will use the default target url.'

@property
def target(self):

    target_url = self.request.GET.get('redirect_url')
    if (target_url and is_safe_url(target_url, self.request.META.get('HTTP_HOST'))):
        return target_url
    else:
        return self.default_target
