there is a question that makes me feel annoyed,what i want to do is when i request the detail.html then the views of Post model will add 1 as the visit counts ,how to do it?thanks.
blog/models.py
class Post(models.Model):
views = models.PositiveIntegerField(default=0)
blog/views.py
def detail(request):
return render(request, 'blog/detail.html')