--------------------------------------------------------------------------------路虽远,行则将至. 事虽难,做则必成. view from django.shortcuts import render,HttpResponse # Create your views here. from app01.models import * from django.core.paginator import Paginato
一.视图层 from django.shortcuts import render # Create your views here. from .models import Book from django.core.paginator import Paginator,EmptyPage def index(request): """ # 批量导入数据 book_list=[] for i in range(100): book = Book.objects.create
https://docs.djangoproject.com/en/2.2/topics/pagination/ Paginator objects¶ The Paginator class has this constructor: class Paginator(object_list, per_page, orphans=0, allow_empty_first_page=True)[source]¶ Required arguments¶ object_list A list, tupl