Django forms date field format

Django defaults dates in forms to the format "2010-01-15". But changing the default format is fairly straight-forward, though there appears to be some confusion about how.

class MyForm(Form):
    
    # the default format is %Y-%m-%d
    date_available = forms.DateField(
        widget=forms.widgets.DateInput(format="%m/%d/%Y"))

Tags:

Updated: