In Django RestFramework, how to change the Api Root documentation?

后端 未结 6 1497
遇见更好的自我
遇见更好的自我 2021-02-04 02:12

In django RestFramework, is there any \"official\" way to generate the documentation for the \"Api Root\" ?

After looking at the RestFramework\'s source code, I\'ve foun

6条回答
  •  梦毁少年i
    2021-02-04 03:12

    If anyone wants an inline style

       router = DefaultRouter()
    
       router.get_api_root_view().cls.__name__ = "Root API name"
       router.get_api_root_view().cls.__doc__ = "Your Description"
    

提交回复
热议问题