将 drf_yasg (swagger) 实施到 django (AssertionError ModelSerializer) 中的问题

问题描述

几天来,我试图将 drf_yasg 实施到 Django==3.1.3 中。我总是按照这里写的说明 -> https://drf-yasg.readthedocs.io/(安装,网址)。 但是,一旦我访问在我的本地机器上的 urls 中定义的 swagger url 总是发生错误 ->: screenshot

并且控制台打印:

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.",)

为什么会这样?如何解决

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)