Full documentation: http://marcgibbons.github.io/django-rest-swagger/
As you may have noticed, I have not been keeping up with pull requests and issues and am looking for help maintaining this project! Between working fulltime, having 2 kids (3 and under), teaching Python and running for political office, I can't possibly keep up. So, if you like this project and want to help out, I'm specifically looking for:
- Issue triage (separating how-to-use from bugs and feature requests)
- Pull request review & triage
Please contact me on Twitter @marcgibb or at marcgbbns at gmail dot com if you are interested!
-
pip install django-rest-swagger
-
Add
rest_framework_swagger
to yourINSTALLED_APPS
setting:INSTALLED_APPS = ( ... 'rest_framework_swagger', )
This package ships with two renderer classes:
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
SwaggerUIRenderer
generates 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
$ tox
to execute the test suite against all supported environments. - Run
./runtests.py
to 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