Linked Questions

Popular Questions

How to implement a click-through function without reloading the page

Asked by At

the site has a button, it is necessary that when you click on it the counter in the database increased. I solved this problem by going to the url with the function, but do not know how to call it without reloading the page.

def add_show_phone(request, product_id):
    entry = Entry.objects.get(id=product_id)
    entry.count_show_phone += 1
    return HttpResponseRedirect('/product/' + product_id)

Related Questions