def get_comments(obj, request, oauth=False, paginate=False, cpp=10):
    """
    Retrieves list of comments related to a certain object and renders
    The appropriate template to view it
    """
    model_object = type(obj).objects.get(id=obj.id)
    comments = Comment.objects.filter_by_object(model_object)
    comments_count = comments.count()
    if paginate:
        paginator = Paginator(comments, cpp)
        page = request.GET.get('page')
        try:
            comments = paginator.page(page)
        except PageNotAnInteger:
            comments = paginator.page(1)
        except EmptyPage:
            comments = paginator.page(paginator.num_pages)

    try:
        profile_app_name = settings.PROFILE_APP_NAME
        profile_model_name = settings.PROFILE_MODEL_NAME
    except AttributeError:
        profile_app_name = None
        profile_model_name = None

    try:
        if settings.LOGIN_URL.startswith("/"):
            login_url = settings.LOGIN_URL
        else:
            login_url = "/" + settings.LOGIN_URL
    except AttributeError:
        login_url = ""

    return {
        "commentform": CommentForm(),
        "model_object": obj,
        "user": request.user,
        "comments": comments,
        # "comments_count": comments_count,
        "oauth": oauth,
        "profile_app_name": profile_app_name,
        "profile_model_name": profile_model_name,
        "paginate": paginate,
        "login_url": login_url,
        "cpp": cpp
    }