Answer the question
In order to leave comments, you need to log in
How to solve the problem of serializing a custom user model?
In my application, I wrote the user model code, which can be viewed at pythonfiddle.com . Application components used:
ValueError at /rest-auth/registration/. Native serializers for the user model were not defined. Settings related to in-app authentication:
Cannot use ModelSerializer with Abstract Models.
AUTH_USER_MODEL='authservice.MyUser'
ACCOUNT_USER_MODEL_USERNAME_FIELD='email'
ACCOUNT_AUTHENTICATION_METHOD='email'
ACCOUNT_EMAIL_VERIFICATION='mandatory'
ACCOUNT_EMAIL_REQUIRED=True
ACCOUNT_EMAIL_CONFIRMATION_EXPIRE_DAYS=2
Answer the question
In order to leave comments, you need to log in
The problem was solved by a more careful study of the values of local variables, which were fixed by the debugger. The problems turned out to be in connecting the authtoken to the application.
to start, do this
and move Meta to the end, behind the methods
class Meta:
verbose_name = _('user')
verbose_name_plural = _('users')
# abstract = False
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question