我是Django和Python的新手,我正在使用Django-rest-framework来构建RESTfull API。validated_data=request.data) return Response(serializer.errors) 我的序列化程序是这样的错误:- TypeError: Field 'id' expected a number but got [28</em
我在当前的django项目中使用会话,最近得到了一个'Object of type 'date' is not JSON serializable'错误--原因是下面的move_in_date字段。True)
我试图按照docs的建议使用DjangoJSONEncoder来解决这个问题,它可以通过SESSION_SERIALIZER=DjangoJSONEncoder的设置来处理日期时间(这是一个序列化程序而不是编码器吗,但是尝试它或SESSION_SERIALIZ
当我试图返回一个JsonResponse时,我会得到这个类型的错误。在后面的代码中,当我试图返回一个json响应时,我的程序一直给我这个错误:TypeError: int() argument must be a string, a bytes-like object/products Traceback (most recent call last): File "C:\Users\alexei\Columns\venv\lib\site-packages\djangoin in