Django authentication
# Django REST importsfrom rest_framework import serializersfrom rest_framework.exceptions import ValidationErrorfrom .models Customerfrom django.shortcuts import get_object_or_404from django.contrib.auth.models import Userclass CustomerSerializer(serializers.ModelSerializer):password = serializers.CharField(max_length=50, write_only=True, required=True)class Meta:model = Customerfields = ['email', 'first_name', 'last_name','phone_number', 'password', 'image']def validate(self, data):if len(data['password']) < 8:raise ValidationError({"Password": "Password must be more than 6 characters"})return data