how to do pagination using mongoengine?
You can use skip
and limit
from QuerySet to achieve pagination.
For example if you want to show the second page with a limitation of 10 items per page, you can do like this:
page_nb = 2
items_per_page = 10
offset = (page_nb - 1) * items_per_page
list = Books.objects.skip( offset ).limit( items_per_page )
The flask-mongoengine plugin has an example of a paginator you could adapt to follow the digg paginator.