[Solved]-How to serialize custom user model in DRF


Instead of

User = settings.AUTH_USER_MODEL


from django.contrib.auth import get_user_model
User = get_user_model()

Remember that settings.AUTH_USER_MODEL is just a string that indicates which user model you will use not the model itself. If you want to get the model, use get_user_model


Leave a comment