title: How to save form by using Input type = "datetime-local" In Django
body: <p>In my form i have an input field of <strong>ENDDATE AND TIME</strong> but when i select end date and time and i give submit the form was not valid.  Here i have mentioned my html, views.py models.py and form.py. i don't why its happening so please help me to do this.</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;label&gt;End Date &amp; Time&lt;/label&gt;
    &lt;div &gt;
       &lt;input class="form-control" id="party"  type = "datetime-local" name="end_date"&gt;
     &lt;/div&gt; 
  </code></pre>
  
  <p><strong>Views.py</strong></p>
  
  <pre><code>def event(request):
      if request.method == 'POST':
          form = EventForm(request.POST, request.FILES)
          if form.is_valid():
              form.save()
              messages.success(request, "Insertion Success!")
              return redirect('/event')
          else:
  
              messages.success(request,"You missed to fill some fields!")
              return HttpResponse(form)
  </code></pre>
  
  <p><strong>form.py</strong></p>
  
  <pre><code>class EventForm(forms.ModelForm):
     class Meta:
         model = Events
         fields = ['end_date']
         widgets = {
          'end_date': DateTimeInput(attrs={'type': 'datetime-local'}),
  }
  </code></pre>
  
  <p><strong>models.py</strong></p>
  
  <pre><code>class Events(models.Model):
      end_date =models.DateTimeField(auto_now=False,blank=True)
  </code></pre>