[Django]-Forms.DateInput default value

2👍

Change :

'start': forms.DateInput(attrs={'class':'datepicker'})

to

'start': forms.DateInput(attrs={'class':'datepicker', 'value': datetime.now().strftime("%d-%m-%Y")})

This will set a default value for the date input field. You can change the date format as per the format you want to set.

Leave a comment