from django import forms
from captcha.fields import CaptchaField
class LoginForm(forms.Form):
tel = forms.CharField(required=True,min_length=12)
email = forms.EmailField(required=True)
name = forms.CharField(required=True,max_length=50)
class_name = forms.CharField(required=True,max_length=50)
captcha = CaptchaField()class LoginView(View):
def get(self,request):
login_form = LoginForm()
return render(request,'blog_form.html',{'login_form':login_form})
def post(self,request):
login_form = LoginForm(request.POST)
if login_form.is_valid():
pass
添加回答
举报
0/150
提交
取消