Will Dx

人世一身霜雪, 归来仍是少年.

django-rest-swagger自动生成restful接口文档

Posted April 07, 2017

1. 安装

Raw
pip install django-rest-swagger

2. 配置

Raw
from rest_framework_swagger.views import get_swagger_view
schema_view = get_swagger_view(title='Pastebin API')
url(r'^swagger/$', schema_view),
Raw
INSTALLED_APPS = [
    ...
    'rest_framework_swagger',
    ...
]

3. 测试