title: Django-Rest-Framework POST request to ManyToMany Field
body: <p>I have a django model that is a message. It has a name which is a CharField, then also an array of users which is a ManyToManyField.</p>
  
  <p>So This is what my API looks like:</p>
  
  <pre><code>[
    {
      "id": 13,
      "content": "hej",
      "date": "2019-07-09",
      "sender": {
          "id": 1,
          "username": "william"
      }
    },
    {
      "id": 14,
      "content": "hej william",
      "date": "2019-07-09",
      "sender": {
          "id": 3,
          "username": "ryan"
      }
    }
  ]
  </code></pre>
  
  <p>What I've tried to send via postman POST:</p>
  
  <pre><code>{
      "content": "Hello",
      "sender": {"username": "william"},
      "date": "2019-09-02"
  }
  </code></pre>
  
  <p>The Error I get:</p>
  
  <pre><code>sqlite3.IntegrityError: NOT NULL constraint failed: chat_message.sender_id
  </code></pre>
  
  <p>ManyToManyField(Userprofile=User):</p>
  
  <pre><code>class Message(models.Model):
    sender = models.ForeignKey(UserProfile, on_delete=models.CASCADE, related_name="sendermessage")
    content = models.CharField(max_length=500)
    date = models.DateField(default=date.today)
    canview = models.ManyToManyField(UserProfile, blank=True, related_name="messagecanview")
  
  class Meta:
      verbose_name_plural = 'Messages'
  
  def __str__(self):
      return "{sender}".format(sender=self.sender)
  </code></pre>