diff --git a/groups/forms.py b/groups/forms.py index 0876b1aa..f941e967 100644 --- a/groups/forms.py +++ b/groups/forms.py @@ -1,6 +1,7 @@ from django import forms - +from captcha.fields import CaptchaField class GroupsForm(forms.Form): username = forms.CharField(label="用户名", max_length=128, widget=forms.TextInput(attrs={'class': 'form-control', 'placeholder': "Username",'autofocus': ''})) password = forms.CharField(label="密码", max_length=256, widget=forms.PasswordInput(attrs={'class': 'form-control','placeholder': "Password"})) + captcha = CaptchaField(label='验证码', error_messages={"invalid":"验证码错误"}) diff --git a/groups/templates/groups/login.html b/groups/templates/groups/login.html index 1ca7f9ba..cdd957b0 100644 --- a/groups/templates/groups/login.html +++ b/groups/templates/groups/login.html @@ -15,8 +15,10 @@