@csrf_exempt
def get_search_words(request):
    if (request.method == 'POST'):
        user_name = request.POST.get('user_name', None)
        user = get_user(user_name)
        word_to_add = request.POST.get('to_add', None)
        if (word_to_add != ''):
            word_to_add = word_to_add.replace('"', '')
            user.add_search_word(word_to_add)
        words_to_remove = jsonpickle.decode(request.POST.get('to_remove', None))
        print(words_to_remove)
        if (words_to_remove != ''):
            words_to_remove = replace_string_character(words_to_remove)
            print(words_to_remove)
            user.remove_search_word(words_to_remove)
        print(user_name)
        print(word_to_add)
        print(user.all_search_words())
        return JsonResponse(user.all_search_words(), safe=False)
    else:
        empty = {}
        return JsonResponse(empty)
@csrf_exempt
def get_search_words(request):
    if (request.method == 'POST'):
        user_name = request.POST.get('user_name', None)
        user = get_user(user_name)
        word_to_add = request.POST.get('to_add', None)
        if (word_to_add != ):
            word_to_add = word_to_add.replace('"', )
            user.add_search_word(word_to_add)
        words_to_remove = jsonpickle.decode(request.POST.get('to_remove', None))
        print(words_to_remove)
        if (words_to_remove != ):
            words_to_remove = replace_string_character(words_to_remove)
            print(words_to_remove)
            user.remove_search_word(words_to_remove)
        print(user_name)
        print(word_to_add)
        print(user.all_search_words())
        return JsonResponse(user.all_search_words(), safe=False)
    else:
        empty = {}
        return JsonResponse(empty)