title: displaying both date and time inputs from DateTImeField - Django
body: <p>I have a django template and a form where I want the user to input a date and time into the right fields and save the date and time into the database. I also want to initialize a specific time when ever the form is created. I currently have the date time field in my model and form but I am not sure how to get it to display both the time and date. it is only showing the default date so far. Here is the code that I have right now.</p>
  
  <p>models:</p>
  
  <pre><code>class Event(models.Model):
      user = models.ForeignKey(User, on_delete=models.CASCADE)
      calendar = models.ForeignKey(Calender, on_delete=models.CASCADE)
      name = models.CharField(max_length=30, default='Event')
      start_date = models.DateTimeField(default='1950-01-01')
      end_date = models.DateTimeField(default='1950-01-01')
      email = models.CharField(max_length=40, default='example@example.com')
      location = models.CharField(max_length=40, default='location')
      notes = models.CharField(max_length=200, default='note')
      repeat = models.IntegerField()
      # 0 = no repeat
      # 1 = daily
      # 2 = weekly
      # monthly
      created = models.DateTimeField(auto_now_add=True)
  </code></pre>
  
  <p>forms:</p>
  
  <pre><code>class CreateEventForm(forms.ModelForm):
      start_date = forms.DateTimeField(
          label='Start',
          widget=forms.widgets.DateInput(attrs={'type':'date'}),
      )
      end_date = forms.DateTimeField(
          label='End',
          widget=forms.widgets.DateInput(attrs={'type':'date'})
      )
      class Meta:
          model = Event
          fields = ['name', 'start_date', 'end_date', 'location', 'notes']
  </code></pre>
  
  <p>views:</p>
  
  <pre><code>form = CreateCalenderForm()
          parameters = {
              'form':form,
          }
          return render(request, 'calender/create_calender.html', parameters)
  </code></pre>
  
  <p>here is what it looks like:</p>
  
  <p><a href="https://i.stack.imgur.com/KcQDx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KcQDx.png" alt="enter image description here"></a></p>