20👍
When you have a custom Django User model make sure you are importing it correctly in files that initiate User (From the Django Docs). So, add the following to the top of your serializers.py file. This fixed the same error for me.
from django.contrib.auth import get_user_model
User = get_user_model()
1👍
Not Indented Properly
class CreateCarrierSerializer(serializers.ModelSerializer):
class Meta:
model = User
fields = ('email','domainID','roleID','user_name','phone')
-1👍
You will also have to update imports so that they point to your new custom User model.
- Readonly fields in the django admin/inline
- Unsupported lookup 'istartwith' for CharField or join on the field not permitted
- Run bash script with Django
- Docker-compose to run django with mongodb
- Strategies to make a web application available offline?
Source:stackexchange.com