Q:

IntegrityError at /new_topic/ NOT NULL constraint failed: learning_logs_topic.owner_id

I am setting topics to have its user owner. But I wonder can I add a new_topic that does not have an owner by setting Null=True to some field?
class Topic(models.Model):
    text = models.CharField(max_length=200)
    date_added = models.DateTimeField(auto_now_add=True)
    owner = models.ForeignKey(User, on_delete=models.CASCADE)

    def __str__(self):           
        return self.text

@login_required
def new_topic(request):
    if request.method != 'POST':
        form = TopicForm()
    else:
        form = TopicForm(request.POST)
        if form.is_valid():
            form.save()

The error said: Not NULL constraint failed. I know the solution as I changed form.save() to the following by set the new_topic with an owner:
    new_topic = form.save(commit=False)
    new_topic.owner = request.user
    new_topic.save()

I cleaned all codes snippets having .owner suffix. I was guessing the problem is because as I Forignkey topic owner with User class, the User class now has a topic attribute(field) that sets Null = False by default So any new_topic should have a user as its owner. Here's what I did: 
class Topic(models.Model):
    text = models.CharField(max_length=200)
    date_added = models.DateTimeField(auto_now_add=True)
    owner = models.ForeignKey(User, on_delete=models.CASCADE, null=True)

    def __str__(self):           
        return self.text

However, I still get the same error.. I guess that because ForeignKey field dose not support Null = True? or I wonder should I change User's topic field rather than Topic's owner field? if so How should I change User's default field? Thank you! 

A:

Please run python manage.py makemigrations and python manage.py migrate after you changed user to have null=True.

