Django form: setting initial value on DateField
<p>I have the following code to set the initial value for a DateField and CharField. CharField's initial value got set properly, but the DateField's initial value is still blank. </p>

<pre><code>class MyForm(forms.ModelForm):
    dummy = fiscal_year_end = forms.CharField()
    date = forms.DateField()

    def __init__(self, *args, **kwargs):

        super(MyForm, self).__init__(*args, **kwargs)
        today = datetime.date.today()
        new_date = datetime.date(year=today.year-1, month=today.month, day=today.day)
        self.fields["date"].initial = new_date
        self.fields["dummy"].initial = 'abc'
</code></pre>