问题详情:
AssertionError: `basename` argument not specified, and could not automatically determine the name from the viewset, as it does not have a `.queryset` attribute.
经排查发现:
当viewset中没有定义queryset字段时在路由的注册必须加上basename
解决方法:
方法1:如果在views.py中没有定义queryset字段,就需要在urls.py中注册路由时,增加basename字段
方法2:在views.py中定义queryset字段,就不需要在urls.py中注册路由时增加basename字段