title: Django Model IntegrityError: NOT NULL constraint failed:
body: <p>I am building a service that makes short URLs. I have the models:</p>
  
  <pre><code>from django.db import models
  
  class ShortURL(models.Model):
      url = models.CharField(max_length = 50)
  
  class LongURL(models.Model):
      name = models.CharField(max_length = 100, null=True)
      url_to_short = models.ForeignKey(ShortURL)
  </code></pre>
  
  <p>I have already run the command: <code>python manage.py migrate</code>
  If I open the interpreter, using <code>python manage.py shell</code> and run this code: </p>
  
  <pre><code>&gt;&gt;&gt; from appshort.models import LongURL
  &gt;&gt;&gt; a = LongURL(name = 'hello_long_link')
  &gt;&gt;&gt; a.save()
  </code></pre>
  
  <p>then I get the error:   </p>
  
  <p><code>django.db.utils.IntegrityError: NOT NULL constraint failed: appshort_longurl.url_to_short_id</code></p>
  
  <p>What did I do wrong?</p>