二.自定义form组件 from django import forms from django.forms import widgets from app01 import models # 定制form组件 class MyForm(forms.Form): username = forms.CharField(max_length=8, min_length=3, label='用户名', error_messages={ 'max_length': '用户名长度超啦,不能超过8位!',…