from django.http import HttpResponse
from django.shortcuts import render
import operator

def home(request):
    return render(request,'home.html',{'hi_there':'This is django-from html'})

def about(request):
    return render(request,'about.html')

def count(request):
    finaltext=request.GET['fulltext']
    worldlist=finaltext.split( )

    worddictionary={}
    for word in worldlist:
        if word in worddictionary:
            #increase
            worddictionary[word]+=1
        else:
            #add to the dictionary
            worddictionary[word]=1
    sortedwords=sorted(worddictionary.items(), key=operator.itemgetter(1), reverse=True)

    return render(request,'count.html',{'finaltext':finaltext,'count':len(worldlist),'sortedwords':worddictionary.items()})
	#.items() is for converting the dictionary into list
	
a91bb7d476b190111263f6becd2b0c9235cc0538
<mask token>


def count(request):
    finaltext = request.GET['fulltext']
    worldlist = finaltext.split()
    worddictionary = {}
    for word in worldlist:
        if word in worddictionary:
            worddictionary[word] += 1
        else:
            worddictionary[word] = 1
    sortedwords = sorted(worddictionary.items(), key=operator.itemgetter(1),
        reverse=True)
    return render(request, 'count.html', {'finaltext': finaltext, 'count':
        len(worldlist), 'sortedwords': worddictionary.items()})

<mask token>


def home(request):
    return render(request, 'home.html', {'hi_there':
        'This is django-from html'})


<mask token>


def count(request):
    finaltext = request.GET['fulltext']
    worldlist = finaltext.split()
    worddictionary = {}
    for word in worldlist:
        if word in worddictionary:
            worddictionary[word] += 1
        else:
            worddictionary[word] = 1
    sortedwords = sorted(worddictionary.items(), key=operator.itemgetter(1),
        reverse=True)
    return render(request, 'count.html', {'finaltext': finaltext, 'count':
        len(worldlist), 'sortedwords': worddictionary.items()})

<mask token>


def home(request):
    return render(request, 'home.html', {'hi_there':
        'This is django-from html'})


def about(request):
    return render(request, 'about.html')


def count(request):
    finaltext = request.GET['fulltext']
    worldlist = finaltext.split()
    worddictionary = {}
    for word in worldlist:
        if word in worddictionary:
            worddictionary[word] += 1
        else:
            worddictionary[word] = 1
    sortedwords = sorted(worddictionary.items(), key=operator.itemgetter(1),
        reverse=True)
    return render(request, 'count.html', {'finaltext': finaltext, 'count':
        len(worldlist), 'sortedwords': worddictionary.items()})

from django.http import HttpResponse
from django.shortcuts import render
import operator


def home(request):
    return render(request, 'home.html', {'hi_there':
        'This is django-from html'})


def about(request):
    return render(request, 'about.html')


def count(request):
    finaltext = request.GET['fulltext']
    worldlist = finaltext.split()
    worddictionary = {}
    for word in worldlist:
        if word in worddictionary:
            worddictionary[word] += 1
        else:
            worddictionary[word] = 1
    sortedwords = sorted(worddictionary.items(), key=operator.itemgetter(1),
        reverse=True)
    return render(request, 'count.html', {'finaltext': finaltext, 'count':
        len(worldlist), 'sortedwords': worddictionary.items()})

from django.http import HttpResponse
from django.shortcuts import render
import operator

def home(request):
    return render(request,'home.html',{'hi_there':'This is django-from html'})

def about(request):
    return render(request,'about.html')

def count(request):
    finaltext=request.GET['fulltext']
    worldlist=finaltext.split( )

    worddictionary={}
    for word in worldlist:
        if word in worddictionary:
            #increase
            worddictionary[word]+=1
        else:
            #add to the dictionary
            worddictionary[word]=1
    sortedwords=sorted(worddictionary.items(), key=operator.itemgetter(1), reverse=True)

    return render(request,'count.html',{'finaltext':finaltext,'count':len(worldlist),'sortedwords':worddictionary.items()})
	#.items() is for converting the dictionary into list
	