Form组件使用 参照文档 https://docs.djangoproject.com/zh-hans/2.2/topics/forms/ 生成HTML标签 创建一个form类 from django import forms class RegForm(forms.Form): name = forms.CharField(max_length=6, label='用户名') pwd = forms.CharField(label='密码', min_length=8, widget=for