render_to blog all-posts html paginate def main request posts Post obj

1
2
3
4
5
@render_to('blog/all-posts.html')
@paginate()
def main(request):
posts = Post.objects.all().select_related()
return {'posts': posts}