I am using django rest framework to create a blog website for fun. I am using neon db for the database. I have a users model in which I have a created_at attribute with datetimetz datatype. I have also set the default value to NOW() and in the serializer i have set the attribute to read_only_fields. But when i'm doing a post request to create a new user, it puts in null in the field and the created_at is filled as null in the database table. My users model: class Users(models.Model): user_id = models.AutoField(primary_key=True,null=False,blank=True) username = models.CharField(max_length=100) email = models.CharField(max_length=254) password_hash = models.CharField(max_length=30, blank=True, null=True) created_at = models.DateTimeField(null=False,blank=True) class Meta: managed = False db_table = 'users' my serializer: class UserSerializer(serializers.ModelSerializer): class Meta: model = Users read_only_fields = ('created_at',) fields = '__all__' my view : class UsersList(APIView): """ get all users or create a single user """ def get(self, request, format=None): users = Users.objects.all() serializer = UserSerializer(users,many=True) return Response(serializer.data,status=status.HTTP_200_OK) def post(self, request, format=None): serializer = UserSerializer(data = request.data) if serializer.is_valid(): serializer.save() return Response(serializer.data,status=status.HTTP_201_CREATED) return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST) i have tried this: class UserSerializer(serializers.ModelSerializer): created_at = serializers.SerializerMethodField() class Meta: model = Users read_only_fields = ('created_at',) fields = '__all__' def get_created_at(self, instance): return instance.created_at.strftime("%B %d %Y") it didn't work plus i don't want to do this. i want DRF to NOT include the created_at field and let the neon db table set the default value for the field. Continue reading...