9.1文档设置
urls.py
from rest_framework.documentation import include_docs_urls
urlpatterns = [
path('docs/',include_docs_urls(title='Zhixheng')),
]
在定义字段的时候加上help_text
在编辑时加上描述
在docs中还可以进行接口测试
本文介绍如何在Django项目中使用rest_framework库设置API文档,通过在urls.py文件中引入include_docs_urls来实现。文章还提到了在定义字段时加入help_text以增强文档描述性,以及如何在编辑时添加更多描述,最后介绍了如何利用docs功能进行接口测试。
9.1文档设置
urls.py
from rest_framework.documentation import include_docs_urls
urlpatterns = [
path('docs/',include_docs_urls(title='Zhixheng')),
]
在定义字段的时候加上help_text
在编辑时加上描述
在docs中还可以进行接口测试
963

被折叠的 条评论
为什么被折叠?