'Figures out the full host name for the given domain part.  The
domain part is a subdomain in case host matching is disabled or
a full host name.'

def get_host(self, domain_part):

    if self.map.host_matching:
        if (domain_part is None):
            return self.server_name
        return to_unicode(domain_part, 'ascii')
    subdomain = domain_part
    if (subdomain is None):
        subdomain = self.subdomain
    else:
        subdomain = to_unicode(subdomain, 'ascii')
    return (((subdomain and (subdomain + u'.')) or u'') + self.server_name)
