title: Django ModelForm not validating correctly with custom date format
body: <p>I'm making a form using Django's forms.ModelForm, but I don't want to use the
  default format for the datefield (in my locale, that's <code>'%Y-%m-%d'</code>). I don't
  remember <em>why</em> I wanted to change it, but at this point I'm determined to figure
  out what the problem is anyway.<br>
  It seems like this question's been asked many times, but most of them are
  slightly different, or the answers don't help me.</p>
  
  <p>This is my form class:
  </p>
  
  <pre><code>class RejectionForm(forms.ModelForm):
      class Meta:
          model = Rejection
          fields = ['date',
                    'plant',
                    'part',
                    'defects',
                    'shift',
                    'station',
                    'worker',
                    'quantity',
                    'location',
                    'rejected_by',
                    'remark']
          widgets = {
              'date': forms.DateInput(attrs={'class': 'date'}, format='%m-%d-%Y')
          }
  
      error_css_class = 'danger'
  </code></pre>
  
  <p>I've also tried it like this:</p>
  
  <pre><code>class RejectionForm(forms.ModelForm):
      date = forms.DateField(
          input_formats=['%m,-%d-%Y'],
          widget=forms.DateInput(
              attrs={'class': 'date'},
              format='%m-%d-%Y'
          )
      )
  
      class Meta:
          model = Rejection
          fields = ['date',
                    'plant',
                    'part',
                    'defects',
                    'shift',
                    'station',
                    'worker',
                    'quantity',
                    'location',
                    'rejected_by',
                    'remark']
  
      error_css_class = 'danger'
  </code></pre>
  
  <p>But that didn't work, either. Maybe for an entirely different reason, but I got
  rid of it. From now on I'll still be referring to the first example.  </p>
  
  <p>I've checked the POST data being sent when I submit the form, using Chrome's
  developer console, and it's sending it using the format that I want. And when
  pre-populated, the value already there is correct, too. So I don't think the
  problem is related to the client, or the way the form is rendered.<br>
  Something that seems kind of weird is that it <em>does</em> validate if I type the date
  in the default format. But it still renders it in the custom format.  </p>
  
  <p>Furthermore, I've tried it with both L10N and I18N disabled. I got the idea from
  the second answer to <a href="https://stackoverflow.com/questions/9410058/">this</a>
  question. Unfortunately (but also kind of fortunately), it didn't work.  </p>
  
  <p>Just in case anyone needs it, here's one of the templates:
  </p>
  
  <pre><code>{% extends 'defective/base.html' %}
  
  {% block content %}
  &lt;form action="{% url 'defective:edit-id' rej_id=rej_id %}" method="POST" id="rejection_form" class="form-group create-form"&gt;
      {% csrf_token %}
  
      &lt;table class="table table-hover"&gt;
          {{ form.as_table }}
      &lt;/table&gt;
  
      &lt;input type="submit" value="Save and view" class="btn btn-primary"&gt;&lt;br&gt;
  &lt;/form&gt;
  
  &lt;script&gt;
      $('.date').datepicker({dateFormat: 'mm-dd-yy'});
  &lt;/script&gt;
  {% endblock %}
  </code></pre>
  
  <p>And the relevant parts of the corresponding view:
  </p>
  
  <pre><code>instance = get_object_or_404(Rejection, pk=rej_id)
  form = RejectionForm(request.POST, instance=instance)
  if form.is_valid():
      form.save()
      return HttpResponseRedirect(reverse('defective:view-id', kwargs={'rej_id': rej_id}))
  else:
      context = {'title': 'Edit an entry',
                 'rej_id': rej_id,
                 'form': form}
      return render(request, 'defective/edit.html', context)
  </code></pre>
  
  <p>I'm not sure exactly what might be needed, so feel free to ask if you want to see anything else.</p>
  
  <p>Edit: It's probably worth noting that it did work in the past. I'm not certain when it stopped, but I remember it working before I started playing around with <a href="https://github.com/alex/django-filter" rel="nofollow noreferrer">django-filter</a>.<br>
  I decided against using it, and removed everything I added for it. There's nothing I can find that got left, and it didn't even call for editing the views or forms, just adding a new file for filters, and added a URL that pointed to a class-based view that came with the app. Neither of which are present now.</p>