Deployed c5be86a6 with MkDocs version: 1.1.2

This commit is contained in:
Tom Christie 2022-01-11 13:02:03 +00:00
parent 2417cc4e20
commit 62f6a3a5ca
11 changed files with 84 additions and 89 deletions

View File

@ -492,7 +492,7 @@ def comment_list(request, format=None):
<p>Also note that <code>format_suffix_patterns</code> does not support descending into <code>include</code> URL patterns.</p>
<h3 id="using-with-i18n_patterns"><a class="toclink" href="#using-with-i18n_patterns">Using with <code>i18n_patterns</code></a></h3>
<p>If using the <code>i18n_patterns</code> function provided by Django, as well as <code>format_suffix_patterns</code> you should make sure that the <code>i18n_patterns</code> function is applied as the final, or outermost function. For example:</p>
<pre><code>url patterns = [
<pre><code>urlpatterns = [
]

View File

@ -562,7 +562,7 @@ class StandardResultsSetPagination(PageNumberPagination):
<p><strong>Response</strong>:</p>
<pre><code>HTTP 200 OK
{
"count": 1023
"count": 1023,
"next": "https://api.example.org/accounts/?page=5",
"previous": "https://api.example.org/accounts/?page=3",
"results": [
@ -600,7 +600,7 @@ class StandardResultsSetPagination(PageNumberPagination):
<p><strong>Response</strong>:</p>
<pre><code>HTTP 200 OK
{
"count": 1023
"count": 1023,
"next": "https://api.example.org/accounts/?limit=100&amp;offset=500",
"previous": "https://api.example.org/accounts/?limit=100&amp;offset=300",
"results": [

View File

@ -1069,6 +1069,7 @@ AccountSerializer():
class Meta:
model = Account
fields = ['url', 'groups']
</code></pre>
<p>Extra fields can correspond to any property or callable on the model.</p>
<h2 id="specifying-read-only-fields"><a class="toclink" href="#specifying-read-only-fields">Specifying read only fields</a></h2>

View File

@ -525,6 +525,11 @@
</code></pre>
<hr />
<h2 id="313x-series"><a class="toclink" href="#313x-series">3.13.x series</a></h2>
<h3 id="3131"><a class="toclink" href="#3131">3.13.1</a></h3>
<p>Date: 15th December 2021</p>
<ul>
<li>Revert schema naming changes with function based <code>@api_view</code>. [#8297]</li>
</ul>
<h3 id="3130"><a class="toclink" href="#3130">3.13.0</a></h3>
<p>Date: 13th December 2021</p>
<ul>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

@ -543,7 +543,7 @@ continued development by <strong><a href="community/funding/">signing up for a p
<p><em>Every single sign-up helps us make REST framework long-term financially sustainable.</em></p>
<ul class="premium-promo promo">
<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/?utm_source=drf&utm_medium=sponsorship&utm_content=developer" style="background-image: url(https://fund-rest-framework.s3.amazonaws.com/stream-130.png)">Stream</a></li>
<li><a href="https://getstream.io/?utm_source=DjangoRESTFramework&utm_medium=Webpage_Logo_Ad&utm_content=Developer&utm_campaign=DjangoRESTFramework_Jan2022_HomePage" style="background-image: url(https://fund-rest-framework.s3.amazonaws.com/stream-130.png)">Stream</a></li>
<li><a href="https://software.esg-usa.com" style="background-image: url(https://fund-rest-framework.s3.amazonaws.com/esg-new-logo.png)">ESG</a></li>
<li><a href="https://rollbar.com" style="background-image: url(https://fund-rest-framework.s3.amazonaws.com/rollbar2.png)">Rollbar</a></li>
<li><a href="https://retool.com/?utm_source=djangorest&utm_medium=sponsorship" style="background-image: url(https://fund-rest-framework.s3.amazonaws.com/retool-sidebar.png)">Retool</a></li>
@ -553,7 +553,7 @@ continued development by <strong><a href="community/funding/">signing up for a p
</ul>
<div style="clear: both; padding-bottom: 20px;"></div>
<p><em>Many thanks to all our <a href="https://fund.django-rest-framework.org/topics/funding/#our-sponsors">wonderful sponsors</a>, and in particular to our premium backers, <a href="https://getsentry.com/welcome/">Sentry</a>, <a href="https://getstream.io/?utm_source=drf&amp;utm_medium=sponsorship&amp;utm_content=developer">Stream</a>, <a href="https://software.esg-usa.com/">ESG</a>, <a href="https://rollbar.com/?utm_source=django&amp;utm_medium=sponsorship&amp;utm_campaign=freetrial">Rollbar</a>, <a href="https://cadre.com">Cadre</a>, <a href="https://hubs.ly/H0f30Lf0">Kloudless</a>, <a href="https://lightsonsoftware.com">Lights On Software</a>, <a href="https://retool.com/?utm_source=djangorest&amp;utm_medium=sponsorship">Retool</a>, <a href="https://bit.io/jobs?utm_source=DRF&amp;utm_medium=sponsor&amp;utm_campaign=DRF_sponsorship">bit.io</a>, <a href="https://posthog.com?utm_source=DRF&amp;utm_medium=sponsor&amp;utm_campaign=DRF_sponsorship">PostHog</a>, and <a href="https://cryptapi.io">CryptAPI</a>.</em></p>
<p><em>Many thanks to all our <a href="https://fund.django-rest-framework.org/topics/funding/#our-sponsors">wonderful sponsors</a>, and in particular to our premium backers, <a href="https://getsentry.com/welcome/">Sentry</a>, <a href="https://getstream.io/?utm_source=DjangoRESTFramework&amp;utm_medium=Webpage_Logo_Ad&amp;utm_content=Developer&amp;utm_campaign=DjangoRESTFramework_Jan2022_HomePage">Stream</a>, <a href="https://software.esg-usa.com/">ESG</a>, <a href="https://rollbar.com/?utm_source=django&amp;utm_medium=sponsorship&amp;utm_campaign=freetrial">Rollbar</a>, <a href="https://cadre.com">Cadre</a>, <a href="https://hubs.ly/H0f30Lf0">Kloudless</a>, <a href="https://lightsonsoftware.com">Lights On Software</a>, <a href="https://retool.com/?utm_source=djangorest&amp;utm_medium=sponsorship">Retool</a>, <a href="https://bit.io/jobs?utm_source=DRF&amp;utm_medium=sponsor&amp;utm_campaign=DRF_sponsorship">bit.io</a>, <a href="https://posthog.com?utm_source=DRF&amp;utm_medium=sponsor&amp;utm_campaign=DRF_sponsorship">PostHog</a>, and <a href="https://cryptapi.io">CryptAPI</a>.</em></p>
<hr />
<h2 id="requirements"><a class="toclink" href="#requirements">Requirements</a></h2>
<p>REST framework requires the following:</p>

File diff suppressed because one or more lines are too long

View File

@ -1,271 +1,271 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><url>
<loc>https://www.django-rest-framework.org/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/tutorial/quickstart/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/tutorial/1-serialization/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/tutorial/2-requests-and-responses/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/tutorial/3-class-based-views/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/tutorial/4-authentication-and-permissions/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/tutorial/5-relationships-and-hyperlinked-apis/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/tutorial/6-viewsets-and-routers/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/api-guide/requests/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/api-guide/responses/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/api-guide/views/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/api-guide/generic-views/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/api-guide/viewsets/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/api-guide/routers/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/api-guide/parsers/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/api-guide/renderers/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/api-guide/serializers/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/api-guide/fields/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/api-guide/relations/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/api-guide/validators/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/api-guide/authentication/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/api-guide/permissions/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/api-guide/caching/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/api-guide/throttling/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/api-guide/filtering/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/api-guide/pagination/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/api-guide/versioning/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/api-guide/content-negotiation/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/api-guide/metadata/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/api-guide/schemas/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/api-guide/format-suffixes/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/api-guide/reverse/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/api-guide/exceptions/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/api-guide/status-codes/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/api-guide/testing/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/api-guide/settings/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/topics/documenting-your-api/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/topics/api-clients/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/topics/internationalization/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/topics/ajax-csrf-cors/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/topics/html-and-forms/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/topics/browser-enhancements/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/topics/browsable-api/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/topics/rest-hypermedia-hateoas/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/community/tutorials-and-resources/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/community/third-party-packages/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/community/contributing/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/community/project-management/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/community/release-notes/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/community/3.13-announcement/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/community/3.12-announcement/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/community/3.11-announcement/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/community/3.10-announcement/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/community/3.9-announcement/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/community/3.8-announcement/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/community/3.7-announcement/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/community/3.6-announcement/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/community/3.5-announcement/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/community/3.4-announcement/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/community/3.3-announcement/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/community/3.2-announcement/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/community/3.1-announcement/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/community/3.0-announcement/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/community/kickstarter-announcement/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/community/mozilla-grant/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/community/funding/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>https://www.django-rest-framework.org/community/jobs/</loc>
<lastmod>2021-12-13</lastmod>
<lastmod>2022-01-11</lastmod>
<changefreq>daily</changefreq>
</url>
</urlset>

Binary file not shown.

View File

@ -500,7 +500,7 @@ cd tutorial
<pre><code>INSTALLED_APPS = [
...
'rest_framework',
'snippets.apps.SnippetsConfig',
'snippets',
]
</code></pre>
<p>Okay, we're ready to roll.</p>
@ -528,7 +528,7 @@ class Snippet(models.Model):
</code></pre>
<p>We'll also need to create an initial migration for our snippet model, and sync the database for the first time.</p>
<pre><code>python manage.py makemigrations snippets
python manage.py migrate
python manage.py migrate snippets
</code></pre>
<h2 id="creating-a-serializer-class"><a class="toclink" href="#creating-a-serializer-class">Creating a Serializer class</a></h2>
<p>The first thing we need to get started on our Web API is to provide a way of serializing and deserializing the snippet instances into representations such as <code>json</code>. We can do this by declaring serializers that work very similar to Django's forms. Create a file in the <code>snippets</code> directory named <code>serializers.py</code> and add the following.</p>
@ -725,8 +725,8 @@ urlpatterns = [
Validating models...
0 errors found
Django version 1.11, using settings 'tutorial.settings'
Development server is running at http://127.0.0.1:8000/
Django version 4.0,1 using settings 'tutorial.settings'
Starting Development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
</code></pre>
<p>In another terminal window, we can test the server.</p>

View File

@ -495,6 +495,7 @@ $ find .
./tutorial/quickstart/models.py
./tutorial/quickstart/tests.py
./tutorial/quickstart/views.py
./tutorial/asgi.py
./tutorial/settings.py
./tutorial/urls.py
./tutorial/wsgi.py
@ -605,12 +606,6 @@ urlpatterns = [
"url": "http://127.0.0.1:8000/users/1/",
"username": "admin"
},
{
"email": "tom@example.com",
"groups": [],
"url": "http://127.0.0.1:8000/users/2/",
"username": "tom"
}
]
}
</code></pre>
@ -630,12 +625,6 @@ HTTP/1.1 200 OK
"url": "http://localhost:8000/users/1/",
"username": "paul"
},
{
"email": "tom@example.com",
"groups": [],
"url": "http://127.0.0.1:8000/users/2/",
"username": "tom"
}
]
}
</code></pre>