我有下面的代码和错误堆栈跟踪。
我正在尝试访问localhost:8000/fundamentals/,但收到错误消息'list' object has no attribute 'values'
错误
web_1 | Traceback (most recent call last):
web_1 | File "/usr/local/lib/python3.7/site-packages/django/core/handlers/exception.py", line 47, in inner
web_1 | response = get_response(request)
web_1 | File "/usr/local/lib/python3.7/site-packages/django/core/handlers/base.py", line 202, in _get_response
web_1 | response = response.render()
web_1 | File "/usr/local/lib/python3.7/site-packages/django/template/response.py", line 105, in render
web_1 | self.content = self.rendered_content
web_1 | File "/usr/local/lib/python3.7/site-packages/rest_framework/response.py", line 70, in rendered_content
web_1 | ret = renderer.render(self.data, accepted_media_type, context)
web_1 | File "/usr/local/lib/python3.7/site-packages/rest_framework/renderers.py", line 724, in render
web_1 | context = self.get_context(data, accepted_media_type, renderer_context)
web_1 | File "/usr/local/lib/python3.7/site-packages/rest_framework/renderers.py", line 655, in get_context
web_1 | raw_data_post_form = self.get_raw_data_form(data, view, 'POST', request)
web_1 | File "/usr/local/lib/python3.7/site-packages/rest_framework/renderers.py", line 563, in get_raw_data_form
web_1 | data = serializer.data.copy()
web_1 | File "/usr/local/lib/python3.7/site-packages/rest_framework/serializers.py", line 562, in data
web_1 | ret = super().data
web_1 | File "/usr/local/lib/python3.7/site-packages/rest_framework/serializers.py", line 264, in data
web_1 | self._data = self.get_initial()
web_1 | File "/usr/local/lib/python3.7/site-packages/rest_framework/serializers.py", line 412, in get_initial
web_1 | for field in self.fields.values()
web_1 | File "/usr/local/lib/python3.7/site-packages/rest_framework/serializers.py", line 413, in <listcomp>
动漫人物
相关分类