forked from encode/django-rest-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Live API documentation (encode#4755)
- Loading branch information
1 parent
7f59ce1
commit 68d2020
Showing
52 changed files
with
5,448 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
coverage: | ||
status: | ||
project: false | ||
patch: false | ||
changes: false | ||
|
||
comment: off |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<style> | ||
.promo li a { | ||
float: left; | ||
width: 130px; | ||
height: 20px; | ||
text-align: center; | ||
margin: 10px 30px; | ||
padding: 150px 0 0 0; | ||
background-position: 0 50%; | ||
background-size: 130px auto; | ||
background-repeat: no-repeat; | ||
font-size: 120%; | ||
color: black; | ||
} | ||
.promo li { | ||
list-style: none; | ||
} | ||
</style> | ||
|
||
# Django REST framework 3.6 | ||
|
||
--- | ||
|
||
## Funding | ||
|
||
The 3.6 release would not have been possible without our [collaborative funding model][funding]. | ||
If you use REST framework commercially and would like to see this work continue, | ||
we strongly encourage you to invest in its continued development by | ||
**[signing up for a paid plan][funding]**. | ||
|
||
<ul class="premium-promo promo"> | ||
<li><a href="http://jobs.rover.com/" style="background-image: url(https://fund-rest-framework.s3.amazonaws.com/rover_130x130.png)">Rover.com</a></li> | ||
<li><a href="https://getsentry.com/welcome/" style="background-image: url(https://fund-rest-framework.s3.amazonaws.com/sentry130.png)">Sentry</a></li> | ||
<li><a href="https://getstream.io/try-the-api/?utm_source=drf&utm_medium=banner&utm_campaign=drf" style="background-image: url(https://fund-rest-framework.s3.amazonaws.com/stream-130.png)">Stream</a></li> | ||
<li><a href="https://hello.machinalis.co.uk/" style="background-image: url(https://fund-rest-framework.s3.amazonaws.com/Machinalis130.png)">Machinalis</a></li> | ||
<li><a href="https://rollbar.com" style="background-image: url(https://fund-rest-framework.s3.amazonaws.com/rollbar.png)">Rollbar</a></li> | ||
<li><a href="https://micropyramid.com/django-rest-framework-development-services/" style="background-image: url(https://fund-rest-framework.s3.amazonaws.com/mp-text-logo.png)">MicroPyramid</a></li> | ||
</ul> | ||
<div style="clear: both; padding-bottom: 20px;"></div> | ||
|
||
*Many thanks to all our [sponsors][sponsors], and in particular to our premium backers, [Rover](http://jobs.rover.com/), [Sentry](https://getsentry.com/welcome/), [Stream](https://getstream.io/?utm_source=drf&utm_medium=banner&utm_campaign=drf), [Machinalis](https://hello.machinalis.co.uk/), [Rollbar](https://rollbar.com), and [MicroPyramid](https://micropyramid.com/django-rest-framework-development-services/).* | ||
|
||
|
||
--- | ||
|
||
## API documentation | ||
|
||
... | ||
|
||
## JavaScript Client | ||
|
||
... | ||
|
||
--- | ||
|
||
## Deprecations | ||
|
||
... | ||
|
||
--- | ||
|
||
[sponsors]: https://fund.django-rest-framework.org/topics/funding/#our-sponsors | ||
[funding]: funding.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
https://github.com/twbs/bootstrap/ | ||
|
||
The MIT License (MIT) | ||
|
||
Copyright (c) 2011-2016 Twitter, Inc. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
https://github.com/bazh/jquery.json-view/ | ||
|
||
The MIT License (MIT) | ||
|
||
Copyright (c) 2014 bazh. (http://github.com/bazh) | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of | ||
this software and associated documentation files (the "Software"), to deal in | ||
the Software without restriction, including without limitation the rights to | ||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | ||
the Software, and to permit persons to whom the Software is furnished to do so, | ||
subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS | ||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR | ||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER | ||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ | |
markdown==2.6.4 | ||
django-guardian==1.4.6 | ||
django-filter==1.0.0 | ||
coreapi==2.0.8 | ||
coreapi==2.2.4 | ||
coreschema==0.0.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
from django.conf.urls import include, url | ||
|
||
from rest_framework.renderers import ( | ||
CoreJSONRenderer, DocumentationRenderer, SchemaJSRenderer | ||
) | ||
from rest_framework.schemas import get_schema_view | ||
|
||
|
||
def get_docs_view(title=None, description=None, schema_url=None, public=True): | ||
renderer_classes = [DocumentationRenderer, CoreJSONRenderer] | ||
|
||
return get_schema_view( | ||
title=title, | ||
url=schema_url, | ||
description=description, | ||
renderer_classes=renderer_classes, | ||
public=public | ||
) | ||
|
||
|
||
def get_schemajs_view(title=None, description=None, schema_url=None, public=True): | ||
renderer_classes = [SchemaJSRenderer] | ||
|
||
return get_schema_view( | ||
title=title, | ||
url=schema_url, | ||
description=description, | ||
renderer_classes=renderer_classes, | ||
public=public | ||
) | ||
|
||
|
||
def include_docs_urls(title=None, description=None, schema_url=None, public=True): | ||
docs_view = get_docs_view( | ||
title=title, | ||
description=description, | ||
schema_url=schema_url, | ||
public=public | ||
) | ||
schema_js_view = get_schemajs_view( | ||
title=title, | ||
description=description, | ||
schema_url=schema_url, | ||
public=public | ||
) | ||
urls = [ | ||
url(r'^$', docs_view, name='docs-index'), | ||
url(r'^schema.js$', schema_js_view, name='schema-js') | ||
] | ||
return include(urls, namespace='api-docs') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.