django-rest-swagger

Swagger Documentation Generator for Django REST Framework

Github星跟踪图

Django REST Swagger: deprecated (2019-06-04)

This project is no longer being maintained. Please consider drf-yasg as an alternative/successor. I haven't personally used it, but it looks feature-complete and is actively maintained.

https://github.com/axnsan12/drf-yasg

Thanks for all the support and contributions over the years. Special thanks to Lights on Software, Lincoln Loop and BNOTIONS for generously donating time to work on this project :heart:.


build-status-badge
codecov
pypi-version

Deploy

An API documentation generator for Swagger UI and Django REST Framework

Full documentation: http://marcgibbons.github.io/django-rest-swagger/

Installation

  1. pip install django-rest-swagger

  2. Add rest_framework_swagger to your INSTALLED_APPS setting:

        INSTALLED_APPS = (
            ...
            'rest_framework_swagger',
        )
    

Rendering Swagger Specification and Documentation

This package ships with two renderer classes:

  1. OpenAPIRenderer generates the OpenAPI (fka Swagger) JSON schema specification. This renderer will be presented if:
  • Content-Type: application/openapi+json is specified in the headers.
  • ?format=openapi is passed as query param
  1. SwaggerUIRenderer generates the Swagger UI and requires the OpenAPIRenderer

Quick Start Example:

from django.conf.urls import url
from rest_framework_swagger.views import get_swagger_view

schema_view = get_swagger_view(title='Pastebin API')

urlpatterns = [
    url(r'^$', schema_view)
]

Requirements

  • Django 1.8+
  • Django REST framework 3.5.1+
  • Python 2.7, 3.5, 3.6

Testing

  • Run $ tox to execute the test suite against all supported environments.
  • Run ./runtests.py to run the test suite within the current environment.

Bugs & Contributions

Please report bugs by opening an issue

Contributions are welcome and are encouraged!

Special Thanks

Many thanks to Tom Christie & all the contributors who have developed Django REST Framework

主要指标

概览
名称与所有者marcgibbons/django-rest-swagger
主编程语言Python
编程语言Python (语言数: 6)
平台
许可证BSD 2-Clause "Simplified" License
所有者活动
创建于2013-06-13 19:28:32
推送于2020-12-14 12:00:00
最后一次提交2019-06-04 14:10:32
发布数48
最新版本名称2.2.0 (发布于 2018-04-30 16:00:09)
第一版名称0.1.1 (发布于 )
用户参与
星数2.6k
关注者数66
派生数606
提交数801
已启用问题?
问题数496
打开的问题数130
拉请求数174
打开的拉请求数36
关闭的拉请求数129
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?