[Fixed]-Got an unexpected keyword argument 'user'

1👍

It looks like you have a method named Usuario and it is imported together with the Usuario model class.

You can also use the .create() method of the default manager to create objects instead of instantiating and saving them manually:

Usuario.objects.create(user=..., ...)

This way you will not need to call the .save() method as it will be automatically saved.

As a side note, it is recommended to follow the PEP 8 naming conventions and name your methods in lowercase_letters and use CamelCase for your classes. This will reduce the number of errors of this type.

👤Selcuk

Leave a comment