Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

django rest framework encrypt passwors

from rest_framework.serializers import ModelSerializer
from django.contrib.auth.hashers import make_password


class UserSerializer(ModelSerializer):
    class Meta:
        model = backend.models.User
        fields = ('username', 'email', 'password',)

    validate_password = make_password
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #django #rest #framework #encrypt #passwors
ADD COMMENT
Topic
Name
4+3 =