Display only some of the page numbers by django pagination

前端 未结 8 1298
盖世英雄少女心
盖世英雄少女心 2020-12-07 10:34

I am using the django paginator in the template. Its working ok, but not good when there\'s large numbers of pages.

views.py:

def blog(request):
             


        
8条回答
  •  北荒
    北荒 (楼主)
    2020-12-07 11:11

    Another shorter solution with template is compare current forloop.counter with certain range.

    with bootstrap I use this template

    
    

提交回复
热议问题