【发布时间】:2021-04-17 20:57:01
【问题描述】:
click here for the image 在密码字段的附件图像中,我需要“****”而不是“pass”,是否有任何可用于 Serialzers 的密码小部件?
【问题讨论】:
标签: python python-3.x django django-rest-framework
click here for the image 在密码字段的附件图像中,我需要“****”而不是“pass”,是否有任何可用于 Serialzers 的密码小部件?
【问题讨论】:
标签: python python-3.x django django-rest-framework
只需在您的序列化器字段中使用样式 arg:
class YourSerializer(serializers.ModelSerializer):
password = serializers.CharField(
style={'input_type': 'password'}
)
class Meta:
# ....
【讨论】: