django Datefiled not use type=date

By default,

Django didnt handle DateField with html

so after rendering,the DateField type will display type=text in the html form ,it is inconvenience for user to input a date

However, you can change widget to specific the type=date

E.g

forms.Datefield(widget=forms.DateInput(attrs={'type':'date'}))


below is doc from Django

留言