from django import forms
class ContactForm(forms.Form):
full_name = forms.CharField()
email = forms.EmailField()
def clean_email(self, *args, **kwargs):
email = self.cleaned_data.get('email')
if email.endswith('@gmail.com'): # etc.
raise forms.ValidationError('This is not a valid email')
return email
你可以在家里做表单.py(你必须创建那个文件)像这样的应用程序
Here you can find more about it
相关问题 更多 >
编程相关推荐