@csrf_exempt
def top_words_per_date_get(request):
    print('top_words_per_date_get')
    words_list = []
    counter_list = []
    days_list = []
    if (request.method == 'POST'):
        queriesManager = QueriesManager()
        (name, locations, start_date, end_date, words_list, logic, exact) = parse_parameters(request)
        days_list = generate_days_list(start_date, end_date)
        dates_counter = dict.fromkeys(days_list)
        print(days_list)
        total_tweets = get_tweet_list(locations, get_user(name), days_list, None, asdocs=True)
        if isinstance(total_tweets, Exception):
            return JsonResponse(str(total_tweets), safe=False, status=500)
        elif (len(total_tweets) == 0):
            return JsonResponse('Error: No Tweets in location and date', safe=False, status=500)
        for (k, _) in dates_counter.items():
            dates_counter[k] = {'word': '', 'count': 0}
        params = ['Popular_word_per_date']
        print(params)
        print(len(total_tweets))
        df = queriesManager.call_querie(params, total_tweets, [])
        print(df)
        words_list = (['No Tweets'] * len(days_list))
        counter_list = ([0] * len(days_list))
        for (i, day) in enumerate(days_list):
            print(day)
            col = df.loc[(df['date'] == day)]
            for (index, row) in col.iterrows():
                words_list[i] = row['popular_word']
                counter_list[i] = row['counter']
        print(days_list)
        print(words_list)
        print(counter_list)
    return JsonResponse({'dates': days_list, 'words': words_list, 'counter': counter_list}, safe=False)
@csrf_exempt
def top_words_per_date_get(request):
    print('top_words_per_date_get')
    words_list = []
    counter_list = []
    days_list = []
    if (request.method == 'POST'):
        queriesManager = QueriesManager()
        (name, locations, start_date, end_date, words_list, logic, exact) = parse_parameters(request)
        days_list = generate_days_list(start_date, end_date)
        dates_counter = dict.fromkeys(days_list)
        print(days_list)
        total_tweets = get_tweet_list(locations, get_user(name), days_list, None, asdocs=True)
        if isinstance(total_tweets, Exception):
            return JsonResponse(str(total_tweets), safe=False, status=500)
        elif (len(total_tweets) == 0):
            return JsonResponse('Error: No Tweets in location and date', safe=False, status=500)
        for (k, _) in dates_counter.items():
            dates_counter[k] = {'word': , 'count': 0}
        params = ['Popular_word_per_date']
        print(params)
        print(len(total_tweets))
        df = queriesManager.call_querie(params, total_tweets, [])
        print(df)
        words_list = (['No Tweets'] * len(days_list))
        counter_list = ([0] * len(days_list))
        for (i, day) in enumerate(days_list):
            print(day)
            col = df.loc[(df['date'] == day)]
            for (index, row) in col.iterrows():
                words_list[i] = row['popular_word']
                counter_list[i] = row['counter']
        print(days_list)
        print(words_list)
        print(counter_list)
    return JsonResponse({'dates': days_list, 'words': words_list, 'counter': counter_list}, safe=False)