@api_view(['GET'])
def get_single_user(request, username):
    '\n    Function view for getting a single user with the specified Username = username\n    '
    context = {'is_public_view': True}
    if ((request.auth is not None) and (request.user.Username == username)):
        context['is_public_view'] = False
    try:
        user = User.objects.get(Username=username)
        return Response(UserSerializer(user, context=context).data, status=status.HTTP_200_OK)
    except Exception as e:
        return Response(str(e), status=status.HTTP_400_BAD_REQUEST)
Function view for getting a single user with the specified Username = username
@api_view(['GET'])
def get_single_user(request, username):
    '\n    \n    '
    context = {'is_public_view': True}
    if ((request.auth is not None) and (request.user.Username == username)):
        context['is_public_view'] = False
    try:
        user = User.objects.get(Username=username)
        return Response(UserSerializer(user, context=context).data, status=status.HTTP_200_OK)
    except Exception as e:
        return Response(str(e), status=status.HTTP_400_BAD_REQUEST)