Error_msg:
AttributeError: Got AttributeError when attempting to get a value for field `password2` on serializer ` UserSerializer`. The serializer field might be named incorrectly and not match any attribute or key on the `User` instance. Original exception text was: 'User' object has no attribute 'password2'. ERROR basehttp 124 "POST /users/ HTTP/1.1" 500 20189 pydev debugger: process 22712 is connecting
问题:
序列化器字段读写设置出错
解决:
serializer中没有write_only_fields关键字, 需要在字段中加write_only=True