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

20👍

Instead of

User = settings.AUTH_USER_MODEL

use

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

👤levi

Leave a comment