Skip to content
Advertisement

TypeError: Post() got an unexpected keyword argument ‘body’ in command line while working on query set

I am working on creating a blog app in Django and while I was making the Query set in cmd I got the following error,

CODE IN CMD:

JavaScript

ERROR :

JavaScript

admin.py :-

JavaScript

models.py:-

JavaScript

ERROR in models.py :-

JavaScript

I am new to Django and don’t know how to resolve the user model, and while creating the query set another error came up. How can I resolve this ?

Advertisement

Answer

You are missing () with body field in your models.py file. It should look like this.

JavaScript

After that, run the following commands,

JavaScript

Then try writing your code in commandline

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement