安装模块

pip install coreapi

需要去settings配置

REST_FRAMEWORK = {
	...
    "DEFAULT_AUTHENTICATION_CLASSES": [],
    'DEFAULT_SCHEMA_CLASS': 'rest_framework.schemas.coreapi.AutoSchema'

}

在总路由加

from rest_framework.documentation import include_docs_urls
urlpatterns = [
	...
    url('docs/', include_docs_urls(title='本项目的接口文档')),
]

在浏览器访问

http://127.0.0.1:8000/docs/

相关文章:

  • 2022-12-23
  • 2021-06-23
  • 2021-09-05
  • 2022-01-14
  • 2021-08-24
  • 2022-12-23
  • 2021-08-08
  • 2022-01-21
猜你喜欢
  • 2022-12-23
  • 2021-09-21
  • 2021-09-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案