The Post could not be created because the data didn't validate - ( When i set past time in form field )
问题 I am building a BlogApp and I am stuck on an Error and I keep getting this error :- The Post could not be created because the data didn't validate. What i am trying to do I made a feature that users cannot insert past date in DateTimeField . AND If user enters the past date in field then a Validation Error should be display. AND i was testing it and suddenly a new error is occured. forms.py class PostForm(forms.ModelForm): date = forms.DateTimeField(initial=timezone.now) def clean_date(self):