Full documentation: http://marcgibbons.github.io/django-rest-swagger/
-
pip install django-rest-swagger -
Add
rest_framework_swaggerto yourINSTALLED_APPSsetting:INSTALLED_APPS = ( ... 'rest_framework_swagger', )
This package ships with two renderer classes:
OpenAPIRenderergenerates the OpenAPI (fka Swagger) JSON schema specification. This renderer will be presented if:
Content-Type: application/openapi+jsonis specified in the headers.?format=openapiis passed as query param
SwaggerUIRenderergenerates the Swagger UI and requires theOpenAPIRenderer
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)
]- Django 1.8+
- Django REST framework 3.5.1+
- Python 2.7, 3.5, 3.6
- Run
$ toxto execute the test suite against all supported environments. - Run
./runtests.pyto run the test suite within the current environment.
Please report bugs by opening an issue
Contributions are welcome and are encouraged!
Many thanks to Tom Christie & all the contributors who have developed Django REST Framework