Form表单验证 1.创建Form类(本质就是正则表达式的集合) from django.forms import Form from django.forms import fields from django.forms import widgets from Mybbs.models import * import re class UserForm(Form): username = fields.CharField( required=True, error_messages={'re
平时我们写表单要自己写样式,比如我们要写一个注册样式,有如下填写项: 实现代码如下: views.py文件 #!/usr/bin/env python #-*-conding:utf-8:-*- from django.shortcuts import render from django import forms # Create your views here. def user_list(request): host = request.POST.get('host') p