How to get html from input and save as variable in Python Django

Solution 1:

You should add if statement before that:

def saveCriteria(request):
    context = {}
    if request.method == "POST":
        title = request.POST.get('quantity')
        print(title)
    return render(request, "home.html", context)