@login_required
@csrf_exempt
def follow_unfollow(request, content_type_id, object_id, do_follow=True, actor_only=True):
 ctype = get_object_or_404(ContentType, pk=content_type_id)
 instance = get_object_or_404(ctype.model_class(), pk=object_id)
 if do_follow:
  actions.follow(request.user, instance, actor_only=actor_only)
  return respond(request, 201)
 actions.unfollow(request.user, instance)
 return respond(request, 204)

@ login_required @ csrf_exempt def follow_unfollow ( request , content_type_id , object_id , do_follow = True , actor_only = True ) : ctype = get_object_or_404 ( ContentType , pk = content_type_id ) instance = get_object_or_404 ( ctype . model_class ( ) , pk = object_id ) if do_follow : actions . follow ( request . user , instance , actor_only = actor_only ) return respond ( request , 201 ) actions . unfollow ( request . user , instance ) return respond ( request , 204 )
creates or deletes the follow relationship between request .