Use try catch and send whatever response you want to send
On Wed, 8 Jan 2020, 10:36 pm Soumen Khatua,
wrote:
>
> *seriazlizers.py*
>
>
>
>
>
>
> *email =
> serializers.EmailField(required=True,validators=[UniqueValidator(queryset=User.objects.all())])
> phone_number = serializers.CharFiel
*seriazlizers.py*
*email =
serializers.EmailField(required=True,validators=[UniqueValidator(queryset=User.objects.all())])
phone_number = serializers.CharField(required =
True,validators=[UniqueValidator(queryset=User.objects.all())])password
= serializers.CharField(write_only=True,
For email you can set email field in model as unique=True and the password
should be stored in hash..
On Wed, 8 Jan 2020, 9:37 pm Soumen Khatua,
wrote:
> Hi Folk,
>
> What is the process to validate fields in django rest framework?
> like email and phone number should be unique and password sho
Hi Folk,
What is the process to validate fields in django rest framework?
like email and phone number should be unique and password should be
alphanumeric character only.
Where i need to write the logic inside serializers or views part and how i
can do that?
Thank you in advance
Regards,
Soumen
4 matches
Mail list logo