Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to customize simplejwt error response message in django restframework

# Import django packages
from django.utils.translation import gettext_lazy as _

# Import external packages
from rest_framework_simplejwt.serializers import TokenObtainPairSerializer as SimpleTokenObtainPairSerializer


class TokenObtainPairSerializer(SimpleTokenObtainPairSerializer):
    default_error_messages = {
        'no_active_account': _('CUSTOM ERROR MESSAGE HERE')
    }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #customize #simplejwt #error #response #message #django #restframework
ADD COMMENT
Topic
Name
4+6 =