django coreapi

1 安装依赖包

pip install coreapi

2 seting.py的文件配置

REST_FRAMEWORK = {
'DEFAULT_SCHEMA_CLASS': 'rest_framework.schemas.AutoSchema',
}

3 url的配置

from django.conf.urls import url
from rest_framework.documentation import include_docs_urls
url(r'^docs/', include_docs_urls(title='接口文档')),

4 访问

http://127.0.0.1:8000/docs/

原文链接: django coreapi 版权所有,转载时请注明出处,违者必究。
注明出处格式:流沙团 ( https://gyarmy.com/post-740.html )

发表评论

0则评论给“django coreapi”