1.REST framework可以自动帮助我们生成接口文档。接口文档以网页的方式呈现。
自动接口文档能生成的是继承自APIView
pip install coreapi
2.使用方法
from rest_framework.documentation import include_docs_urls urlpatterns = [ ... # 生成DRF文档的配置 url(r'^docs/', include_docs_urls(title="慕学生鲜")), ... ]
3. 浏览器访问, 此时肯定会报错, 'AutoSchema' object has no attribute 'get_link', 原因如下, 即从3.10开始 REST就把 AutoSchema 从 coreapi 迁移到了OpenAPI 里,
转载自 https://www.cnblogs.com/knighterrant/p/10597651.html
--- 君子处其实,不处其华;治其内,不治其外 张居正 ----