我正在使用 djoser 和 django rest 框架,我想从创建用户表单中删除用户名字段:
settings.py
:
'SERIALIZERS': {
'user_create': 'user.serializers.UserRegistrationSerializer',
},
serializers.py
:
class UserRegistrationSerializer(BaseUserRegistrationSerializer):
class Meta(BaseUserRegistrationSerializer.Meta):
fields = ('email', 'password')
我收到以下错误。你如何解决这个问题?
TypeError at /auth/users/create create_user() missing 1 required positional argument: 'username'