[Fixed]-Django – no such column: blog_comment.body error

1👍

This is because you have not run migrations in order to apply the body column to the database.

Just run ./manage.py makemigrations and ./manage.py migrate

Django will ask you to enter a default value since you have declared the body field as not nullable.

If you don’t want to enter a default value, write it like this:

body = models.TextField(blank=True, null=True) 

and then run the same commads.

👤nik_m

Leave a comment