custom_token.py 263 B

123456789
  1. from rest_framework import serializers
  2. class CustomTokenSerializer(serializers.Serializer):
  3. user_id = serializers.IntegerField(source='user.pk')
  4. auth_token = serializers.CharField(source="key")
  5. class Meta:
  6. fields = ("user_id", "auth_token")