def post_list(request):
    queryset_list = Post.objects.all().order_by('-publish', 'id')
    paginator = Paginator(queryset_list, 25)
    page = request.GET.get('page')
    try:
        post_list = paginator.page(page)
    except PageNotAnInteger:
        post_list = paginator.page(1)
    except EmptyPage:
        post_list = paginator.page(paginator.num_pages)
    return render(request, 'pages/home.html', {'post_list': post_list})
def post_list(request):
    queryset_list = Post.objects.all().order_by('-publish', 'id')
    paginator = Paginator(queryset_list, 25)
    page = request.GET.get('page')
    try:
        post_list = paginator.page(page)
    except PageNotAnInteger:
        post_list = paginator.page(1)
    except EmptyPage:
        post_list = paginator.page(paginator.num_pages)
    return render(request, 'pages/home.html', {'post_list': post_list})