Deployed 7f16ed77 with MkDocs version: 0.16.3

This commit is contained in:
Carlton Gibson 2019-04-29 15:40:36 +01:00
parent 3769016112
commit 65bf134c46
10 changed files with 3794 additions and 3777 deletions

View File

@ -831,10 +831,11 @@ explicitly declare the <code>BooleanField</code> on the serializer class, or use
<h2 id="datetimefield"><a class="toclink" href="#datetimefield">DateTimeField</a></h2>
<p>A date and time representation.</p>
<p>Corresponds to <code>django.db.models.fields.DateTimeField</code>.</p>
<p><strong>Signature:</strong> <code>DateTimeField(format=api_settings.DATETIME_FORMAT, input_formats=None)</code></p>
<p><strong>Signature:</strong> <code>DateTimeField(format=api_settings.DATETIME_FORMAT, input_formats=None, default_timezone=None)</code></p>
<ul>
<li><code>format</code> - A string representing the output format. If not specified, this defaults to the same value as the <code>DATETIME_FORMAT</code> settings key, which will be <code>'iso-8601'</code> unless set. Setting to a format string indicates that <code>to_representation</code> return values should be coerced to string output. Format strings are described below. Setting this value to <code>None</code> indicates that Python <code>datetime</code> objects should be returned by <code>to_representation</code>. In this case the datetime encoding will be determined by the renderer.</li>
<li><code>input_formats</code> - A list of strings representing the input formats which may be used to parse the date. If not specified, the <code>DATETIME_INPUT_FORMATS</code> setting will be used, which defaults to <code>['iso-8601']</code>.</li>
<li><code>default_timezone</code> - A <code>pytz.timezone</code> representing the timezone. If not specified and the <code>USE_TZ</code> setting is enabled, this defaults to the <a href="https://docs.djangoproject.com/en/stable/topics/i18n/timezones/#default-time-zone-and-current-time-zone">current timezone</a>. If <code>USE_TZ</code> is disabled, then datetime objects will be naive.</li>
</ul>
<h4 id="datetimefield-format-strings"><a class="toclink" href="#datetimefield-format-strings"><code>DateTimeField</code> format strings.</a></h4>
<p>Format strings may either be <a href="https://docs.python.org/3/library/datetime.html#strftime-and-strptime-behavior">Python strftime formats</a> which explicitly specify the format, or the special string <code>'iso-8601'</code>, which indicates that <a href="https://www.w3.org/TR/NOTE-datetime">ISO 8601</a> style datetimes should be used. (eg <code>'2013-01-29T12:34:56.000000Z'</code>)</p>

View File

@ -547,7 +547,7 @@ or if you override the <code>get_object</code> method on a generic view, then yo
</code></pre>
<hr />
<p><strong>Note</strong>: With the exception of <code>DjangoObjectPermissions</code>, the provided
permission classes in <code>rest_framework.permssions</code> <strong>do not</strong> implement the
permission classes in <code>rest_framework.permissions</code> <strong>do not</strong> implement the
methods necessary to check object permissions.</p>
<p>If you wish to use the provided permission classes in order to check object
permissions, <strong>you must</strong> subclass them and implement the

View File

@ -539,7 +539,7 @@ can render the schema into the commonly used YAML-based OpenAPI format.</p>
<pre><code>pip install coreapi pyyaml
</code></pre>
<h2 id="quickstart"><a class="toclink" href="#quickstart">Quickstart</a></h2>
<p>There are two different ways you can serve a schema description for you API.</p>
<p>There are two different ways you can serve a schema description for your API.</p>
<h3 id="generating-a-schema-with-the-generateschema-management-command"><a class="toclink" href="#generating-a-schema-with-the-generateschema-management-command">Generating a schema with the <code>generateschema</code> management command</a></h3>
<p>To generate a static API schema, use the <code>generateschema</code> management command.</p>
<pre><code class="shell">$ python manage.py generateschema &gt; schema.yml

View File

@ -1085,6 +1085,7 @@ AccountSerializer():
user.save()
return user
</code></pre>
<p>Please keep in mind that, if the field has already been explicitly declared on the serializer class, then the <code>extra_kwargs</code> option will be ignored.</p>
<h2 id="relational-fields"><a class="toclink" href="#relational-fields">Relational fields</a></h2>
<p>When serializing model instances, there are a number of different ways you might choose to represent relationships. The default representation for <code>ModelSerializer</code> is to use the primary keys of the related instances.</p>
<p>Alternative representations include serializing using hyperlinks, serializing complete nested representations, or serializing with a custom representation.</p>
@ -1111,7 +1112,7 @@ AccountSerializer():
<p>The default implementation returns a serializer class based on the <code>serializer_field_mapping</code> attribute.</p>
<h3 id="build_relational_fieldself-field_name-relation_info"><a class="toclink" href="#build_relational_fieldself-field_name-relation_info"><code>.build_relational_field(self, field_name, relation_info)</code></a></h3>
<p>Called to generate a serializer field that maps to a relational model field.</p>
<p>The default implementation returns a serializer class based on the <code>serializer_relational_field</code> attribute.</p>
<p>The default implementation returns a serializer class based on the <code>serializer_related_field</code> attribute.</p>
<p>The <code>relation_info</code> argument is a named tuple, that contains <code>model_field</code>, <code>related_model</code>, <code>to_many</code> and <code>has_through_model</code> properties.</p>
<h3 id="build_nested_fieldself-field_name-relation_info-nested_depth"><a class="toclink" href="#build_nested_fieldself-field_name-relation_info-nested_depth"><code>.build_nested_field(self, field_name, relation_info, nested_depth)</code></a></h3>
<p>Called to generate a serializer field that maps to a relational model field, when the <code>depth</code> option has been set.</p>
@ -1375,7 +1376,7 @@ def all_high_scores(request):
def to_representation(self, obj):
for attribute_name in dir(obj):
attribute = getattr(obj, attribute_name)
if attribute_name('_'):
if attribute_name.startswith('_'):
# Ignore private attributes.
pass
elif hasattr(attribute, '__call__'):

View File

@ -875,7 +875,7 @@ def all_high_scores(request):
def to_representation(self, obj):
for attribute_name in dir(obj):
attribute = getattr(obj, attribute_name)
if attribute_name('_'):
if attribute_name.startswith('_'):
# Ignore private attributes.
pass
elif hasattr(attribute, '__call__'):

View File

@ -505,6 +505,14 @@
</code></pre>
<hr />
<h2 id="39x-series"><a class="toclink" href="#39x-series">3.9.x series</a></h2>
<h3 id="393"><a class="toclink" href="#393">3.9.3</a></h3>
<p><strong>Date</strong>: [29th April 2019]</p>
<p>This is the last Django REST Framework release that will support Python 2.
Be sure to upgrade to Python 3 before upgrading to Django REST Framework 3.10.</p>
<ul>
<li>Adjusted the compat check for django-guardian to allow the last guardian
version (v1.4.9) compatible with Python 2. <a href="https://github.com/encode/django-rest-framework/issues/6613">#6613</a></li>
</ul>
<h3 id="392"><a class="toclink" href="#392">3.9.2</a></h3>
<p><strong>Date</strong>: <a href="https://github.com/encode/django-rest-framework/milestone/71?closed=1">3rd March 2019</a></p>
<ul>
@ -525,7 +533,7 @@
<li>Introduced <code>RemovedInDRF…Warning</code> classes to simplify deprecations. <a href="https://github.com/encode/django-rest-framework/issues/6480">#6480</a></li>
</ul>
<h3 id="391"><a class="toclink" href="#391">3.9.1</a></h3>
<p><strong>Date</strong>: <a href="https://github.com/encode/django-rest-framework/milestone/71?closed=1">16th Janurary 2019</a></p>
<p><strong>Date</strong>: <a href="https://github.com/encode/django-rest-framework/milestone/71?closed=1">16th January 2019</a></p>
<ul>
<li>Resolve XSS issue in browsable API. <a href="https://github.com/encode/django-rest-framework/issues/6330">#6330</a></li>
<li>Upgrade Bootstrap to 3.4.0 to resolve XSS issue.</li>
@ -1578,6 +1586,8 @@ Previously may have been stored internally as <code>None</code>.</p>
<!-- 3.9.1 -->
<!-- 3.9.2 -->
<!-- 3.9.3 -->
</div> <!--/span-->

View File

@ -633,6 +633,7 @@ You probably want to also tag the version now:
<li><a href="https://github.com/raphaelgyory/django-rest-messaging">django-rest-messaging</a>, <a href="https://github.com/raphaelgyory/django-rest-messaging-centrifugo">django-rest-messaging-centrifugo</a> and <a href="https://github.com/raphaelgyory/django-rest-messaging-js">django-rest-messaging-js</a> - A real-time pluggable messaging service using DRM.</li>
<li><a href="https://github.com/dealertrack/djangorest-alchemy">djangorest-alchemy</a> - SQLAlchemy support for REST framework.</li>
<li><a href="https://github.com/izimobil/django-rest-framework-datatables">djangorestframework-datatables</a> - Seamless integration between Django REST framework and <a href="https://datatables.net">Datatables</a>.</li>
<li><a href="https://github.com/jozo/django-rest-framework-condition">django-rest-framework-condition</a> - Decorators for managing HTTP cache headers for Django REST framework (ETag and Last-modified).</li>
</ul>

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
<url>
<loc>https://www.django-rest-framework.org//</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
@ -13,49 +13,49 @@
<url>
<loc>https://www.django-rest-framework.org//tutorial/quickstart/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//tutorial/1-serialization/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//tutorial/2-requests-and-responses/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//tutorial/3-class-based-views/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//tutorial/4-authentication-and-permissions/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//tutorial/5-relationships-and-hyperlinked-apis/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//tutorial/6-viewsets-and-routers/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//tutorial/7-schemas-and-client-libraries/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
@ -65,169 +65,169 @@
<url>
<loc>https://www.django-rest-framework.org//api-guide/requests/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//api-guide/responses/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//api-guide/views/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//api-guide/generic-views/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//api-guide/viewsets/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//api-guide/routers/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//api-guide/parsers/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//api-guide/renderers/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//api-guide/serializers/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//api-guide/fields/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//api-guide/relations/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//api-guide/validators/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//api-guide/authentication/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//api-guide/permissions/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//api-guide/caching/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//api-guide/throttling/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//api-guide/filtering/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//api-guide/pagination/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//api-guide/versioning/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//api-guide/content-negotiation/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//api-guide/metadata/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//api-guide/schemas/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//api-guide/format-suffixes/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//api-guide/reverse/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//api-guide/exceptions/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//api-guide/status-codes/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//api-guide/testing/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//api-guide/settings/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
@ -237,49 +237,49 @@
<url>
<loc>https://www.django-rest-framework.org//topics/documenting-your-api/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//topics/api-clients/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//topics/internationalization/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//topics/ajax-csrf-cors/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//topics/html-and-forms/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//topics/browser-enhancements/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//topics/browsable-api/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//topics/rest-hypermedia-hateoas/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
@ -289,115 +289,115 @@
<url>
<loc>https://www.django-rest-framework.org//community/tutorials-and-resources/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//community/third-party-packages/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//community/contributing/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//community/project-management/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//community/release-notes/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//community/3.9-announcement/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//community/3.8-announcement/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//community/3.7-announcement/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//community/3.6-announcement/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//community/3.5-announcement/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//community/3.4-announcement/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//community/3.3-announcement/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//community/3.2-announcement/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//community/3.1-announcement/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//community/3.0-announcement/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//community/kickstarter-announcement/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//community/mozilla-grant/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//community/funding/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://www.django-rest-framework.org//community/jobs/</loc>
<lastmod>2019-03-14</lastmod>
<lastmod>2019-04-29</lastmod>
<changefreq>daily</changefreq>
</url>

View File

@ -465,7 +465,7 @@
<p>This tutorial will cover creating a simple pastebin code highlighting Web API. Along the way it will introduce the various components that make up REST framework, and give you a comprehensive understanding of how everything fits together.</p>
<p>The tutorial is fairly in-depth, so you should probably get a cookie and a cup of your favorite brew before getting started. If you just want a quick overview, you should head over to the <a href="../quickstart/">quickstart</a> documentation instead.</p>
<hr />
<p><strong>Note</strong>: The code for this tutorial is available in the <a href="https://github.com/encode/rest-framework-tutorial">tomchristie/rest-framework-tutorial</a> repository on GitHub. The completed implementation is also online as a sandbox version for testing, <a href="https://restframework.herokuapp.com/">available here</a>.</p>
<p><strong>Note</strong>: The code for this tutorial is available in the <a href="https://github.com/encode/rest-framework-tutorial">encode/rest-framework-tutorial</a> repository on GitHub. The completed implementation is also online as a sandbox version for testing, <a href="https://restframework.herokuapp.com/">available here</a>.</p>
<hr />
<h2 id="setting-up-a-new-environment"><a class="toclink" href="#setting-up-a-new-environment">Setting up a new environment</a></h2>
<p>Before we do anything else we'll create a new virtual environment, using <a href="http://www.virtualenv.org/en/latest/index.html">virtualenv</a>. This will make sure our package configuration is kept nicely isolated from any other projects we're working on.</p>
@ -638,7 +638,6 @@ For the moment we won't use any of REST framework's other features, we'll just w
<p>Edit the <code>snippets/views.py</code> file, and add the following.</p>
<pre><code>from django.http import HttpResponse, JsonResponse
from django.views.decorators.csrf import csrf_exempt
from rest_framework.renderers import JSONRenderer
from rest_framework.parsers import JSONParser
from snippets.models import Snippet
from snippets.serializers import SnippetSerializer