title: Django Form DateInput with widget in update: loosing the initial value
body: <p>I need a DateInput field in a ModelForm with the default HTML datepicker (I'm not using 3rd party libraries). </p>
  
  <p>Since the DateInput is rendered with <code>&lt;input type = "text"&gt;</code> by default, the datepicker is missing (it comes for free with <code>&lt;input type = "date"&gt;</code>) </p>
  
  <p>I've found some examples explaining how to change the input type by handling <code>widget</code> parameters (below the code I've done so far)</p>
  
  <h2>The issue</h2>
  
  <p>I have the datepicker working correctly but in "update mode" when passing initial date value to the form (see view part), the date remains empty in the HTML. </p>
  
  <p>I've tried to find the cause and it seems that the <code>'type': 'date'</code> part in the widget customization is clearing the initial value is some way; in fact, removing it, the initial value date is displayed again, but I loose the datepicker of course.</p>
  
  <p>In the view the date is passed with a valid value</p>
  
  <p>I also found another similar unanswered <a href="https://stackoverflow.com/questions/60130151/django-forms-dateinput-widget-not-populating">question</a> where the field was declared as</p>
  
  <pre><code>class DateInput(forms.DateInput):
      input_type = 'date'
  
  date_effet = forms.DateField(widget=forms.DateInput(format='%d-%m-%Y'), label='Date effet')
  </code></pre>
  
  <p>the problem still remains</p>
  
  <h2>My code</h2>
  
  <h3>model.py</h3>
  
  <pre><code>class TimesheetItem(models.Model):
  
      date = models.DateField()
      description = models.CharField(max_length=100)
      # many other fields here
  </code></pre>
  
  <h3>form.py</h3>
  
  <pre><code>class TimesheetItemForm(forms.ModelForm):
  
      def __init__(self, *args, **kwargs):
          super().__init__(*args, **kwargs)
          # init is used for other fields initialization and crispy forms
  
  
      class Meta:
          model = TimesheetItem
          fields = ['date', 'description']
  
          widgets = {
              'date': forms.DateInput(
                  format=('%d/%m/%Y'),
                  attrs={'class': 'form-control', 
                         'placeholder': 'Select a date',
                         'type': 'date'  # &lt;--- IF I REMOVE THIS LINE, THE INITIAL VALUE IS DISPLAYED
                        }),
          }
  </code></pre>
  
  <h3> view.py</h3>
  
  <pre><code>def edit(request, uuid):
      try:
          timesheet_entry_item = TimesheetItem.objects.get(uuid=uuid)
  
          if request.method == 'POST':
              form = TimesheetItemForm(
                  data=request.POST,
                  instance=timesheet_entry_item
              )
  
              if form.is_valid():
                  pass # save the form
          else:
              form = TimesheetItemForm(initial={
                  'date': timesheet_entry_item.date,  # &lt;--- the date here has a valid value
                  'description': timesheet_entry_item.description
              })
          return render(request, 'template.html', {'form': form})
      except ObjectDoesNotExist:
          raise Http404("error")
  </code></pre>
  
  <p>Thanks for any help</p>
  
  <p>M.</p>