[Answered ]-Cannot resolve keyword 'phone' into field django

1πŸ‘

βœ…

The error is caused by phone field:

class Meta:
    model = User
    fields = ('username', 'email', 'phone', 'password1', 'password2',)
                                    ^^^^^^

In your case, fields in class Meta is used to specify which fields of your User model will be in your form. You can omit some fields of your model with it.

Your User model does not have a field named phone. Adding this field to your model will solve your problem and do not forget executing python manage.py makemigrations.

If your model has this field, then you might forget applying migrations with python manage.py makemigrations.

πŸ‘€black

Leave a comment