def METHOD_NAME(request, project_id, public=True, template='project_hierarchy.html'):
    """."""
    project = get_object_or_404(Project, pk=project_id)
    # Non-editors are not allowed to view unpublished projects
    check_project_viewing_permissions(request, project)
    if public and not project.has_relations():
        raise Http404
    hierarchy_grid = get_hierarchy_grid(project, include_private=not public)
    context = {
        'project': project,
        'hierarchy_grid': hierarchy_grid,
    }
    return render(request, template, context)