1👍
✅
I’m going to point out @Daniel Roseman’s comment above – don’t use this form for saving passwords, at least not how you’re doing it. For other forms though: You want required
, not blank
. Blank is for models, required is for forms.
class LoginForm(forms.Form):
username=forms.CharField(label="Username",max_length=30,required=False)
password=forms.CharField(label="Password",widget=forms.PasswordInput(),required=False)
1👍
use required=True instead of blank=False
e.g:
username=forms.CharField(label="Username",max_length=30,required=True)
In Django, blank=False in models correlates to required=True in forms.
- [Answered ]-Don't fail if log files are unavailable
- [Answered ]-Notify user about bounced confirmation emails
- [Answered ]-How does Django RESTful Framework get user model from token from HTTP header?
- [Answered ]-Exceptions in send_mail when fail_silently=True
Source:stackexchange.com