title: What's the reason for IntegrityError: NOT NULL constraint failed?
body: <p>I'm doing the polls apps in Django Documentation: <a href="https://docs.djangoproject.com/en/1.11/intro/tutorial02/" rel="nofollow noreferrer">Writing your first Django app, part 2</a>. While working with Database API, I've found an IntegrityError.</p>
  
  <p>polls/models.py</p>
  
  <pre><code>class Question(models.Model):
      question_text=models.CharField(max_length=200)
      pub_date=models.DateTimeField('date published')
  </code></pre>
  
  <p>I've tried to create an object of Question model.</p>
  
  <pre><code>Question.objects.create(question_text="What's up?")
  </code></pre>
  
  <p>This gives an error</p>
  
  <blockquote>
    <p>IntegrityError: NOT NULL constraint failed: polls_question.pub_date</p>
  </blockquote>
  
  <p>But when i try this</p>
  
  <pre><code>Question.objects.create(pub_date=timezone.now())
  </code></pre>
  
  <p>It creates an object successfully. </p>
  
  <p>What's the reason for IntegrityError in the first case and why it doesn't generate any error in the second case?</p>