AttributeError: модуль «rest_framework.serializers» не имеет атрибута «PasswordInput»
serializer.py:
from rest_framework import serializers
from django.contrib.auth.models import User
class SampleSerializer(serializers.ModelSerializer):
password2 = serializers.CharField(widget=serializers.PasswordInput())
class Meta:
model = User
fields = ['username','email','password']