Implementation of Swagger UI for Django Rest Framework
Project description
.. role:: python(code) :language: python
Rest-Swagger
An API documentation generator for Swagger UI and Django REST Framework
Installation
-
pip install rest-swagger
-
Add
rest_swagger
to yourINSTALLED_APPS
setting:INSTALLED_APPS = ( ... 'rest_swagger', )
Rendering Swagger Specification and Documentation
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
Quick Start Example:
from django.conf.urls import url
from rest_swagger.views import get_swagger_view
schema_view = get_swagger_view(title='Pastebin API')
urlpatterns = [
url(r'^$', schema_view)
]
Requirements
- Django >=2.2
- Django REST framework >=3.5
- Python >=3.7
Bugs & Contributions
Please report bugs by opening an issue
Contributions are welcome and are encouraged!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
rest-swagger-1.0.0.tar.gz
(498.3 kB
view details)
Built Distribution
File details
Details for the file rest-swagger-1.0.0.tar.gz
.
File metadata
- Download URL: rest-swagger-1.0.0.tar.gz
- Upload date:
- Size: 498.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
b9d1e71db40891321ead54a14661f1836f9c4e4a1f828e9bb8190ab6e2b0d7b0
|
|
MD5 |
a272243581c17480c97f59881f19092c
|
|
BLAKE2b-256 |
54d05fc5773bfdbcf4acde67d04a2469fa391f419a679fb90497d826aca06843
|
File details
Details for the file rest_swagger-1.0.0-py2.py3-none-any.whl
.
File metadata
- Download URL: rest_swagger-1.0.0-py2.py3-none-any.whl
- Upload date:
- Size: 555.2 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
358b0219ed400eb59a8e34efe2c621537c163ad0f61857d5197b2ca15a7a2a49
|
|
MD5 |
ec81be09d55b3f9f6236bd78ceeea939
|
|
BLAKE2b-256 |
294aeb2bda90fca702a0410f1c103604c855497fe404af0dd922e844d18b80a6
|