Django:(5)分页器 & forms组件
Django组件:分页器 目录结构: urls.py from django.contrib import admin from django.urls import path from app01 import views urlpatterns = [ path( ' admin/ ' , admin.site.urls), path(r " index/ " ,views.index) ] models.py from django.db import models # Create your models here. class Book(models.Model): title = models.CharField(max_length=32 ) price = models.DecimalField(decimal_places=2,max_digits=8) views.py from django.shortcuts import render # Create your views here. from app01.models import Book # 导入分页器 from django.core.paginator import Paginator,EmptyPage def index(request): """ # 批量插入数据 # for i in