mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-26 03:23:59 +03:00
Deployed c5be86a6
with MkDocs version: 1.1.2
This commit is contained in:
parent
2417cc4e20
commit
62f6a3a5ca
|
@ -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>
|
<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>
|
<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>
|
<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 = [
|
||||||
…
|
…
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -562,7 +562,7 @@ class StandardResultsSetPagination(PageNumberPagination):
|
||||||
<p><strong>Response</strong>:</p>
|
<p><strong>Response</strong>:</p>
|
||||||
<pre><code>HTTP 200 OK
|
<pre><code>HTTP 200 OK
|
||||||
{
|
{
|
||||||
"count": 1023
|
"count": 1023,
|
||||||
"next": "https://api.example.org/accounts/?page=5",
|
"next": "https://api.example.org/accounts/?page=5",
|
||||||
"previous": "https://api.example.org/accounts/?page=3",
|
"previous": "https://api.example.org/accounts/?page=3",
|
||||||
"results": [
|
"results": [
|
||||||
|
@ -600,7 +600,7 @@ class StandardResultsSetPagination(PageNumberPagination):
|
||||||
<p><strong>Response</strong>:</p>
|
<p><strong>Response</strong>:</p>
|
||||||
<pre><code>HTTP 200 OK
|
<pre><code>HTTP 200 OK
|
||||||
{
|
{
|
||||||
"count": 1023
|
"count": 1023,
|
||||||
"next": "https://api.example.org/accounts/?limit=100&offset=500",
|
"next": "https://api.example.org/accounts/?limit=100&offset=500",
|
||||||
"previous": "https://api.example.org/accounts/?limit=100&offset=300",
|
"previous": "https://api.example.org/accounts/?limit=100&offset=300",
|
||||||
"results": [
|
"results": [
|
||||||
|
|
|
@ -1069,6 +1069,7 @@ AccountSerializer():
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Account
|
model = Account
|
||||||
|
fields = ['url', 'groups']
|
||||||
</code></pre>
|
</code></pre>
|
||||||
<p>Extra fields can correspond to any property or callable on the model.</p>
|
<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>
|
<h2 id="specifying-read-only-fields"><a class="toclink" href="#specifying-read-only-fields">Specifying read only fields</a></h2>
|
||||||
|
|
|
@ -525,6 +525,11 @@
|
||||||
</code></pre>
|
</code></pre>
|
||||||
<hr />
|
<hr />
|
||||||
<h2 id="313x-series"><a class="toclink" href="#313x-series">3.13.x series</a></h2>
|
<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>
|
<h3 id="3130"><a class="toclink" href="#3130">3.13.0</a></h3>
|
||||||
<p>Date: 13th December 2021</p>
|
<p>Date: 13th December 2021</p>
|
||||||
<ul>
|
<ul>
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 27 KiB |
|
@ -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>
|
<p><em>Every single sign-up helps us make REST framework long-term financially sustainable.</em></p>
|
||||||
<ul class="premium-promo promo">
|
<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://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://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://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>
|
<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>
|
</ul>
|
||||||
<div style="clear: both; padding-bottom: 20px;"></div>
|
<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&utm_medium=sponsorship&utm_content=developer">Stream</a>, <a href="https://software.esg-usa.com/">ESG</a>, <a href="https://rollbar.com/?utm_source=django&utm_medium=sponsorship&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&utm_medium=sponsorship">Retool</a>, <a href="https://bit.io/jobs?utm_source=DRF&utm_medium=sponsor&utm_campaign=DRF_sponsorship">bit.io</a>, <a href="https://posthog.com?utm_source=DRF&utm_medium=sponsor&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&utm_medium=Webpage_Logo_Ad&utm_content=Developer&utm_campaign=DjangoRESTFramework_Jan2022_HomePage">Stream</a>, <a href="https://software.esg-usa.com/">ESG</a>, <a href="https://rollbar.com/?utm_source=django&utm_medium=sponsorship&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&utm_medium=sponsorship">Retool</a>, <a href="https://bit.io/jobs?utm_source=DRF&utm_medium=sponsor&utm_campaign=DRF_sponsorship">bit.io</a>, <a href="https://posthog.com?utm_source=DRF&utm_medium=sponsor&utm_campaign=DRF_sponsorship">PostHog</a>, and <a href="https://cryptapi.io">CryptAPI</a>.</em></p>
|
||||||
<hr />
|
<hr />
|
||||||
<h2 id="requirements"><a class="toclink" href="#requirements">Requirements</a></h2>
|
<h2 id="requirements"><a class="toclink" href="#requirements">Requirements</a></h2>
|
||||||
<p>REST framework requires the following:</p>
|
<p>REST framework requires the following:</p>
|
||||||
|
|
File diff suppressed because one or more lines are too long
134
sitemap.xml
134
sitemap.xml
|
@ -1,271 +1,271 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><url>
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><url>
|
||||||
<loc>https://www.django-rest-framework.org/</loc>
|
<loc>https://www.django-rest-framework.org/</loc>
|
||||||
<lastmod>2021-12-13</lastmod>
|
<lastmod>2022-01-11</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/tutorial/quickstart/</loc>
|
<loc>https://www.django-rest-framework.org/tutorial/quickstart/</loc>
|
||||||
<lastmod>2021-12-13</lastmod>
|
<lastmod>2022-01-11</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/tutorial/1-serialization/</loc>
|
<loc>https://www.django-rest-framework.org/tutorial/1-serialization/</loc>
|
||||||
<lastmod>2021-12-13</lastmod>
|
<lastmod>2022-01-11</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/tutorial/2-requests-and-responses/</loc>
|
<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>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/tutorial/3-class-based-views/</loc>
|
<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>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/tutorial/4-authentication-and-permissions/</loc>
|
<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>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/tutorial/5-relationships-and-hyperlinked-apis/</loc>
|
<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>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/tutorial/6-viewsets-and-routers/</loc>
|
<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>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/api-guide/requests/</loc>
|
<loc>https://www.django-rest-framework.org/api-guide/requests/</loc>
|
||||||
<lastmod>2021-12-13</lastmod>
|
<lastmod>2022-01-11</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/api-guide/responses/</loc>
|
<loc>https://www.django-rest-framework.org/api-guide/responses/</loc>
|
||||||
<lastmod>2021-12-13</lastmod>
|
<lastmod>2022-01-11</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/api-guide/views/</loc>
|
<loc>https://www.django-rest-framework.org/api-guide/views/</loc>
|
||||||
<lastmod>2021-12-13</lastmod>
|
<lastmod>2022-01-11</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/api-guide/generic-views/</loc>
|
<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>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/api-guide/viewsets/</loc>
|
<loc>https://www.django-rest-framework.org/api-guide/viewsets/</loc>
|
||||||
<lastmod>2021-12-13</lastmod>
|
<lastmod>2022-01-11</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/api-guide/routers/</loc>
|
<loc>https://www.django-rest-framework.org/api-guide/routers/</loc>
|
||||||
<lastmod>2021-12-13</lastmod>
|
<lastmod>2022-01-11</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/api-guide/parsers/</loc>
|
<loc>https://www.django-rest-framework.org/api-guide/parsers/</loc>
|
||||||
<lastmod>2021-12-13</lastmod>
|
<lastmod>2022-01-11</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/api-guide/renderers/</loc>
|
<loc>https://www.django-rest-framework.org/api-guide/renderers/</loc>
|
||||||
<lastmod>2021-12-13</lastmod>
|
<lastmod>2022-01-11</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/api-guide/serializers/</loc>
|
<loc>https://www.django-rest-framework.org/api-guide/serializers/</loc>
|
||||||
<lastmod>2021-12-13</lastmod>
|
<lastmod>2022-01-11</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/api-guide/fields/</loc>
|
<loc>https://www.django-rest-framework.org/api-guide/fields/</loc>
|
||||||
<lastmod>2021-12-13</lastmod>
|
<lastmod>2022-01-11</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/api-guide/relations/</loc>
|
<loc>https://www.django-rest-framework.org/api-guide/relations/</loc>
|
||||||
<lastmod>2021-12-13</lastmod>
|
<lastmod>2022-01-11</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/api-guide/validators/</loc>
|
<loc>https://www.django-rest-framework.org/api-guide/validators/</loc>
|
||||||
<lastmod>2021-12-13</lastmod>
|
<lastmod>2022-01-11</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/api-guide/authentication/</loc>
|
<loc>https://www.django-rest-framework.org/api-guide/authentication/</loc>
|
||||||
<lastmod>2021-12-13</lastmod>
|
<lastmod>2022-01-11</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/api-guide/permissions/</loc>
|
<loc>https://www.django-rest-framework.org/api-guide/permissions/</loc>
|
||||||
<lastmod>2021-12-13</lastmod>
|
<lastmod>2022-01-11</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/api-guide/caching/</loc>
|
<loc>https://www.django-rest-framework.org/api-guide/caching/</loc>
|
||||||
<lastmod>2021-12-13</lastmod>
|
<lastmod>2022-01-11</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/api-guide/throttling/</loc>
|
<loc>https://www.django-rest-framework.org/api-guide/throttling/</loc>
|
||||||
<lastmod>2021-12-13</lastmod>
|
<lastmod>2022-01-11</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/api-guide/filtering/</loc>
|
<loc>https://www.django-rest-framework.org/api-guide/filtering/</loc>
|
||||||
<lastmod>2021-12-13</lastmod>
|
<lastmod>2022-01-11</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/api-guide/pagination/</loc>
|
<loc>https://www.django-rest-framework.org/api-guide/pagination/</loc>
|
||||||
<lastmod>2021-12-13</lastmod>
|
<lastmod>2022-01-11</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/api-guide/versioning/</loc>
|
<loc>https://www.django-rest-framework.org/api-guide/versioning/</loc>
|
||||||
<lastmod>2021-12-13</lastmod>
|
<lastmod>2022-01-11</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/api-guide/content-negotiation/</loc>
|
<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>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/api-guide/metadata/</loc>
|
<loc>https://www.django-rest-framework.org/api-guide/metadata/</loc>
|
||||||
<lastmod>2021-12-13</lastmod>
|
<lastmod>2022-01-11</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/api-guide/schemas/</loc>
|
<loc>https://www.django-rest-framework.org/api-guide/schemas/</loc>
|
||||||
<lastmod>2021-12-13</lastmod>
|
<lastmod>2022-01-11</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/api-guide/format-suffixes/</loc>
|
<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>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/api-guide/reverse/</loc>
|
<loc>https://www.django-rest-framework.org/api-guide/reverse/</loc>
|
||||||
<lastmod>2021-12-13</lastmod>
|
<lastmod>2022-01-11</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/api-guide/exceptions/</loc>
|
<loc>https://www.django-rest-framework.org/api-guide/exceptions/</loc>
|
||||||
<lastmod>2021-12-13</lastmod>
|
<lastmod>2022-01-11</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/api-guide/status-codes/</loc>
|
<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>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/api-guide/testing/</loc>
|
<loc>https://www.django-rest-framework.org/api-guide/testing/</loc>
|
||||||
<lastmod>2021-12-13</lastmod>
|
<lastmod>2022-01-11</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/api-guide/settings/</loc>
|
<loc>https://www.django-rest-framework.org/api-guide/settings/</loc>
|
||||||
<lastmod>2021-12-13</lastmod>
|
<lastmod>2022-01-11</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/topics/documenting-your-api/</loc>
|
<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>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/topics/api-clients/</loc>
|
<loc>https://www.django-rest-framework.org/topics/api-clients/</loc>
|
||||||
<lastmod>2021-12-13</lastmod>
|
<lastmod>2022-01-11</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/topics/internationalization/</loc>
|
<loc>https://www.django-rest-framework.org/topics/internationalization/</loc>
|
||||||
<lastmod>2021-12-13</lastmod>
|
<lastmod>2022-01-11</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/topics/ajax-csrf-cors/</loc>
|
<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>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/topics/html-and-forms/</loc>
|
<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>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/topics/browser-enhancements/</loc>
|
<loc>https://www.django-rest-framework.org/topics/browser-enhancements/</loc>
|
||||||
<lastmod>2021-12-13</lastmod>
|
<lastmod>2022-01-11</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/topics/browsable-api/</loc>
|
<loc>https://www.django-rest-framework.org/topics/browsable-api/</loc>
|
||||||
<lastmod>2021-12-13</lastmod>
|
<lastmod>2022-01-11</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/topics/rest-hypermedia-hateoas/</loc>
|
<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>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/community/tutorials-and-resources/</loc>
|
<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>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/community/third-party-packages/</loc>
|
<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>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/community/contributing/</loc>
|
<loc>https://www.django-rest-framework.org/community/contributing/</loc>
|
||||||
<lastmod>2021-12-13</lastmod>
|
<lastmod>2022-01-11</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/community/project-management/</loc>
|
<loc>https://www.django-rest-framework.org/community/project-management/</loc>
|
||||||
<lastmod>2021-12-13</lastmod>
|
<lastmod>2022-01-11</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/community/release-notes/</loc>
|
<loc>https://www.django-rest-framework.org/community/release-notes/</loc>
|
||||||
<lastmod>2021-12-13</lastmod>
|
<lastmod>2022-01-11</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/community/3.13-announcement/</loc>
|
<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>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/community/3.12-announcement/</loc>
|
<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>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/community/3.11-announcement/</loc>
|
<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>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/community/3.10-announcement/</loc>
|
<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>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/community/3.9-announcement/</loc>
|
<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>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/community/3.8-announcement/</loc>
|
<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>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/community/3.7-announcement/</loc>
|
<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>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/community/3.6-announcement/</loc>
|
<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>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/community/3.5-announcement/</loc>
|
<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>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/community/3.4-announcement/</loc>
|
<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>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/community/3.3-announcement/</loc>
|
<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>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/community/3.2-announcement/</loc>
|
<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>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/community/3.1-announcement/</loc>
|
<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>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/community/3.0-announcement/</loc>
|
<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>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/community/kickstarter-announcement/</loc>
|
<loc>https://www.django-rest-framework.org/community/kickstarter-announcement/</loc>
|
||||||
<lastmod>2021-12-13</lastmod>
|
<lastmod>2022-01-11</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/community/mozilla-grant/</loc>
|
<loc>https://www.django-rest-framework.org/community/mozilla-grant/</loc>
|
||||||
<lastmod>2021-12-13</lastmod>
|
<lastmod>2022-01-11</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/community/funding/</loc>
|
<loc>https://www.django-rest-framework.org/community/funding/</loc>
|
||||||
<lastmod>2021-12-13</lastmod>
|
<lastmod>2022-01-11</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url><url>
|
</url><url>
|
||||||
<loc>https://www.django-rest-framework.org/community/jobs/</loc>
|
<loc>https://www.django-rest-framework.org/community/jobs/</loc>
|
||||||
<lastmod>2021-12-13</lastmod>
|
<lastmod>2022-01-11</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
</url>
|
</url>
|
||||||
</urlset>
|
</urlset>
|
BIN
sitemap.xml.gz
BIN
sitemap.xml.gz
Binary file not shown.
|
@ -500,7 +500,7 @@ cd tutorial
|
||||||
<pre><code>INSTALLED_APPS = [
|
<pre><code>INSTALLED_APPS = [
|
||||||
...
|
...
|
||||||
'rest_framework',
|
'rest_framework',
|
||||||
'snippets.apps.SnippetsConfig',
|
'snippets',
|
||||||
]
|
]
|
||||||
</code></pre>
|
</code></pre>
|
||||||
<p>Okay, we're ready to roll.</p>
|
<p>Okay, we're ready to roll.</p>
|
||||||
|
@ -528,7 +528,7 @@ class Snippet(models.Model):
|
||||||
</code></pre>
|
</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>
|
<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
|
<pre><code>python manage.py makemigrations snippets
|
||||||
python manage.py migrate
|
python manage.py migrate snippets
|
||||||
</code></pre>
|
</code></pre>
|
||||||
<h2 id="creating-a-serializer-class"><a class="toclink" href="#creating-a-serializer-class">Creating a Serializer class</a></h2>
|
<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>
|
<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...
|
Validating models...
|
||||||
|
|
||||||
0 errors found
|
0 errors found
|
||||||
Django version 1.11, using settings 'tutorial.settings'
|
Django version 4.0,1 using settings 'tutorial.settings'
|
||||||
Development server is running at http://127.0.0.1:8000/
|
Starting Development server at http://127.0.0.1:8000/
|
||||||
Quit the server with CONTROL-C.
|
Quit the server with CONTROL-C.
|
||||||
</code></pre>
|
</code></pre>
|
||||||
<p>In another terminal window, we can test the server.</p>
|
<p>In another terminal window, we can test the server.</p>
|
||||||
|
|
|
@ -495,6 +495,7 @@ $ find .
|
||||||
./tutorial/quickstart/models.py
|
./tutorial/quickstart/models.py
|
||||||
./tutorial/quickstart/tests.py
|
./tutorial/quickstart/tests.py
|
||||||
./tutorial/quickstart/views.py
|
./tutorial/quickstart/views.py
|
||||||
|
./tutorial/asgi.py
|
||||||
./tutorial/settings.py
|
./tutorial/settings.py
|
||||||
./tutorial/urls.py
|
./tutorial/urls.py
|
||||||
./tutorial/wsgi.py
|
./tutorial/wsgi.py
|
||||||
|
@ -605,12 +606,6 @@ urlpatterns = [
|
||||||
"url": "http://127.0.0.1:8000/users/1/",
|
"url": "http://127.0.0.1:8000/users/1/",
|
||||||
"username": "admin"
|
"username": "admin"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"email": "tom@example.com",
|
|
||||||
"groups": [],
|
|
||||||
"url": "http://127.0.0.1:8000/users/2/",
|
|
||||||
"username": "tom"
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
@ -630,12 +625,6 @@ HTTP/1.1 200 OK
|
||||||
"url": "http://localhost:8000/users/1/",
|
"url": "http://localhost:8000/users/1/",
|
||||||
"username": "paul"
|
"username": "paul"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"email": "tom@example.com",
|
|
||||||
"groups": [],
|
|
||||||
"url": "http://127.0.0.1:8000/users/2/",
|
|
||||||
"username": "tom"
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user