mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-22 17:47:04 +03:00
Latest docs build
This commit is contained in:
parent
480b64d313
commit
e6fd79fd88
|
@ -182,6 +182,7 @@
|
|||
<li><a href="#example">Example</a></li>
|
||||
<li class="main"><a href="#third-party-packages">Third party packages</a></li>
|
||||
<li><a href="#messagepack">MessagePack</a></li>
|
||||
<li><a href="#camelcase-json">CamelCase JSON</a></li>
|
||||
|
||||
<div>
|
||||
<hr>
|
||||
|
@ -338,6 +339,8 @@ def parse(self, stream, media_type=None, parser_context=None):
|
|||
<p>The following third party packages are also available.</p>
|
||||
<h2 id="messagepack">MessagePack</h2>
|
||||
<p><a href="https://github.com/juanriaza/django-rest-framework-msgpack">MessagePack</a> is a fast, efficient binary serialization format. <a href="https://github.com/juanriaza">Juan Riaza</a> maintains the <a href="https://github.com/juanriaza/django-rest-framework-msgpack">djangorestframework-msgpack</a> package which provides MessagePack renderer and parser support for REST framework.</p>
|
||||
<h2 id="camelcase-json">CamelCase JSON</h2>
|
||||
<p><a href="https://github.com/vbabiy/djangorestframework-camel-case">djangorestframework-camel-case</a> provides camel case JSON renderers and parsers for REST framework. This allows serializers to use Python-style underscored field names, but be exposed in the API as Javascript-style camel case field names. It is maintained by <a href="https://github.com/vbabiy">Vitaly Babiy</a>.</p>
|
||||
</div><!--/span-->
|
||||
</div><!--/row-->
|
||||
</div><!--/.fluid-container-->
|
||||
|
|
|
@ -195,6 +195,7 @@
|
|||
<li><a href="#messagepack">MessagePack</a></li>
|
||||
<li><a href="#csv">CSV</a></li>
|
||||
<li><a href="#ultrajson">UltraJSON</a></li>
|
||||
<li><a href="#camelcase-json">CamelCase JSON</a></li>
|
||||
|
||||
<div>
|
||||
<hr>
|
||||
|
@ -508,6 +509,8 @@ In this case you can underspecify the media types it should respond to, by using
|
|||
<p>Comma-separated values are a plain-text tabular data format, that can be easily imported into spreadsheet applications. <a href="https://github.com/mjumbewu">Mjumbe Poe</a> maintains the <a href="https://github.com/mjumbewu/django-rest-framework-csv">djangorestframework-csv</a> package which provides CSV renderer support for REST framework.</p>
|
||||
<h2 id="ultrajson">UltraJSON</h2>
|
||||
<p><a href="https://github.com/esnme/ultrajson">UltraJSON</a> is an optimized C JSON encoder which can give significantly faster JSON rendering. <a href="https://github.com/hzy">Jacob Haslehurst</a> maintains the <a href="https://github.com/gizmag/drf-ujson-renderer">drf-ujson-renderer</a> package which implements JSON rendering using the UJSON package.</p>
|
||||
<h2 id="camelcase-json">CamelCase JSON</h2>
|
||||
<p><a href="https://github.com/vbabiy/djangorestframework-camel-case">djangorestframework-camel-case</a> provides camel case JSON renderers and parsers for REST framework. This allows serializers to use Python-style underscored field names, but be exposed in the API as Javascript-style camel case field names. It is maintained by <a href="https://github.com/vbabiy">Vitaly Babiy</a>.</p>
|
||||
</div><!--/span-->
|
||||
</div><!--/row-->
|
||||
</div><!--/.fluid-container-->
|
||||
|
|
|
@ -223,7 +223,7 @@
|
|||
<p>There are many ways you can contribute to Django REST framework. We'd like it to be a community-led project, so please get involved and help shape the future of the project.</p>
|
||||
<h2 id="community">Community</h2>
|
||||
<p>The most important thing you can do to help push the REST framework project forward is to be actively involved wherever possible. Code contributions are often overvalued as being the primary way to get involved in a project, we don't believe that needs to be the case.</p>
|
||||
<p>If you use REST framework, we'd love you to be vocal about your experiences with it - you might consider writing a blog post about using REST framework, or publishing a tutorial about building a project with a particularJjavascript framework. Experiences from beginners can be particularly helpful because you'll be in the best position to assess which bits of REST framework are more difficult to understand and work with.</p>
|
||||
<p>If you use REST framework, we'd love you to be vocal about your experiences with it - you might consider writing a blog post about using REST framework, or publishing a tutorial about building a project with a particular Javascript framework. Experiences from beginners can be particularly helpful because you'll be in the best position to assess which bits of REST framework are more difficult to understand and work with.</p>
|
||||
<p>Other really great ways you can help move the community forward include helping answer questions on the <a href="https://groups.google.com/forum/?fromgroups#!forum/django-rest-framework">discussion group</a>, or setting up an <a href="http://stackexchange.com/filters/66475/rest-framework">email alert on StackOverflow</a> so that you get notified of any new questions with the <code>django-rest-framework</code> tag.</p>
|
||||
<p>When answering questions make sure to help future contributors find their way around by hyperlinking wherever possible to related threads and tickets, and include backlinks from those items if relevant. </p>
|
||||
<h2 id="code-of-conduct">Code of conduct</h2>
|
||||
|
|
|
@ -363,9 +363,11 @@ content
|
|||
# '{"pk": 2, "title": "", "code": "print \\"hello, world\\"\\n", "linenos": false, "language": "python", "style": "friendly"}'
|
||||
</code></pre>
|
||||
<p>Deserialization is similar. First we parse a stream into Python native datatypes... </p>
|
||||
<pre class="prettyprint lang-py"><code>import StringIO
|
||||
<pre class="prettyprint lang-py"><code># This import will use either `StringIO.StringIO` or `io.BytesIO`
|
||||
# as appropriate, depending on if we're running Python 2 or Python 3.
|
||||
from rest_framework.compat import BytesIO
|
||||
|
||||
stream = StringIO.StringIO(content)
|
||||
stream = BytesIO(content)
|
||||
data = JSONParser().parse(stream)
|
||||
</code></pre>
|
||||
<p>...then we restore those native datatypes into to a fully populated object instance.</p>
|
||||
|
|
Loading…
Reference in New Issue
Block a user