几天来,我试图在 Django==3.1.3 中实现 drf_yasg。我总是按照这里写的说明-> https://drf-yasg.readthedocs.io/(安装,网址)。但是,一旦我访问本地机器上的 url 中定义的 swagger url,总是会发生错误->: 截图
控制台打印:
AssertionError: ("Creating a ModelSerializer without either the 'fields' attribute or
the 'exclude' attribute has been deprecated since 3.3.0, and is now disallowed. Add an explicit
fields = '__all__' to the UserTokenSerializer serializer.",)
为什么会这样?如何解决?