'Determine canonical project domain as subdomain'

def _get_project_subdomain(self, project):

    public_domain = getattr(settings, 'PUBLIC_DOMAIN', None)
    if self._use_subdomain():
        project = self._get_canonical_project(project)
        subdomain_slug = project.slug.replace('_', '-')
        return ('%s.%s' % (subdomain_slug, public_domain))
