Last active
February 24, 2022 11:21
-
-
Save therealak12/fabb845f7ec8cbd84857d48f2eec5773 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.contrib.auth import get_user_model | |
from rest_framework import serializers | |
from rest_framework_simplejwt.serializers import TokenObtainPairSerializer as JwtTokenObtainPairSerializer | |
class TokenObtainPairSerializer(JwtTokenObtainPairSerializer): | |
username_field = get_user_model().USERNAME_FIELD | |
class UserSerializer(serializers.ModelSerializer): | |
class Meta: | |
model = get_user_model() | |
fields = ('email', 'password') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment