Skip to content

Commit 9381ce1

Browse files
committed
Deployed 453196e with MkDocs version: 0.16.3
1 parent 2f04365 commit 9381ce1

File tree

25 files changed

+180
-177
lines changed

25 files changed

+180
-177
lines changed

api-guide/parsers/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ <h2 id="fileuploadparser"><a class="toclink" href="#fileuploadparser">FileUpload
571571
<p><strong>.media_type</strong>: <code>*/*</code></p>
572572
<h5 id="notes"><a class="toclink" href="#notes">Notes:</a></h5>
573573
<ul>
574-
<li>The <code>FileUploadParser</code> is for usage with native clients that can upload the file as a raw data request. For web-based uploads, or for native clients with multipart upload support, you should use the <code>MultiPartParser</code> parser instead.</li>
574+
<li>The <code>FileUploadParser</code> is for usage with native clients that can upload the file as a raw data request. For web-based uploads, or for native clients with multipart upload support, you should use the <code>MultiPartParser</code> instead.</li>
575575
<li>Since this parser's <code>media_type</code> matches any content type, <code>FileUploadParser</code> should generally be the only parser set on an API view.</li>
576576
<li><code>FileUploadParser</code> respects Django's standard <code>FILE_UPLOAD_HANDLERS</code> setting, and the <code>request.upload_handlers</code> attribute. See the <a href="https://docs.djangoproject.com/en/stable/topics/http/file-uploads/#upload-handlers">Django documentation</a> for more details.</li>
577577
</ul>

api-guide/permissions/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ <h2 id="setting-the-permission-policy"><a class="toclink" href="#setting-the-per
591591
</code></pre>
592592
<p><strong>Note:</strong> when you set new permission classes through class attribute or decorators you're telling the view to ignore the default list set over the <strong>settings.py</strong> file.</p>
593593
<p>Provided they inherit from <code>rest_framework.permissions.BasePermission</code>, permissions can be composed using standard Python bitwise operators. For example, <code>IsAuthenticatedOrReadOnly</code> could be written:</p>
594-
<pre><code>from rest_framework.permissions import BasePermission, IsAuthenticated
594+
<pre><code>from rest_framework.permissions import BasePermission, IsAuthenticated, SAFE_METHODS
595595
from rest_framework.response import Response
596596
from rest_framework.views import APIView
597597

@@ -714,7 +714,7 @@ <h1 id="third-party-packages"><a class="toclink" href="#third-party-packages">Th
714714
<h2 id="composed-permissions"><a class="toclink" href="#composed-permissions">Composed Permissions</a></h2>
715715
<p>The <a href="https://github.com/niwibe/djangorestframework-composed-permissions">Composed Permissions</a> package provides a simple way to define complex and multi-depth (with logic operators) permission objects, using small and reusable components.</p>
716716
<h2 id="rest-condition"><a class="toclink" href="#rest-condition">REST Condition</a></h2>
717-
<p>The <a href="https://github.com/caxap/rest_condition">REST Condition</a> package is another extension for building complex permissions in a simple and convenient way. The extension allows you to combine permissions with logical operators.</p>
717+
<p>The <a href="https://github.com/caxap/rest_condition">REST Condition</a> package is another extension for building complex permissions in a simple and convenient way. The extension allows you to combine permissions with logical operators.</p>
718718
<h2 id="dry-rest-permissions"><a class="toclink" href="#dry-rest-permissions">DRY Rest Permissions</a></h2>
719719
<p>The <a href="https://github.com/Helioscene/dry-rest-permissions">DRY Rest Permissions</a> package provides the ability to define different permissions for individual default and custom actions. This package is made for apps with permissions that are derived from relationships defined in the app's data model. It also supports permission checks being returned to a client app through the API's serializer. Additionally it supports adding permissions to the default and custom list actions to restrict the data they retrieve per user.</p>
720720
<h2 id="django-rest-framework-roles"><a class="toclink" href="#django-rest-framework-roles">Django Rest Framework Roles</a></h2>

api-guide/relations/index.html

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -536,9 +536,8 @@ <h3 id="myModalLabel">Documentation search</h3>
536536

537537
<h1 id="serializer-relations"><a class="toclink" href="#serializer-relations">Serializer relations</a></h1>
538538
<blockquote>
539-
<p>Bad programmers worry about the code.
540-
Good programmers worry about data structures and their relationships.</p>
541-
<p>&mdash; <a href="https://lwn.net/Articles/193245/">Linus Torvalds</a></p>
539+
<p>Data structures, not algorithms, are central to programming.</p>
540+
<p>&mdash; <a href="http://users.ece.utexas.edu/~adnan/pike.html">Rob Pike</a></p>
542541
</blockquote>
543542
<p>Relational fields are used to represent model relationships. They can be applied to <code>ForeignKey</code>, <code>ManyToManyField</code> and <code>OneToOneField</code> relationships, as well as to reverse relationships, and custom relationships such as <code>GenericForeignKey</code>.</p>
544543
<hr />
@@ -549,7 +548,7 @@ <h4 id="inspecting-relationships"><a class="toclink" href="#inspecting-relations
549548
<p>To do so, open the Django shell, using <code>python manage.py shell</code>, then import the serializer class, instantiate it, and print the object representation…</p>
550549
<pre><code>&gt;&gt;&gt; from myapp.serializers import AccountSerializer
551550
&gt;&gt;&gt; serializer = AccountSerializer()
552-
&gt;&gt;&gt; print repr(serializer) # Or `print(repr(serializer))` in Python 3.x.
551+
&gt;&gt;&gt; print(repr(serializer))
553552
AccountSerializer():
554553
id = IntegerField(label='ID', read_only=True)
555554
name = CharField(allow_blank=True, max_length=100, required=False)

api-guide/renderers/index.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ <h2 id="jsonrenderer"><a class="toclink" href="#jsonrenderer">JSONRenderer</a></
633633
</code></pre>
634634
<p>The default JSON encoding style can be altered using the <code>UNICODE_JSON</code> and <code>COMPACT_JSON</code> settings keys.</p>
635635
<p><strong>.media_type</strong>: <code>application/json</code></p>
636-
<p><strong>.format</strong>: <code>'.json'</code></p>
636+
<p><strong>.format</strong>: <code>'json'</code></p>
637637
<p><strong>.charset</strong>: <code>None</code></p>
638638
<h2 id="templatehtmlrenderer"><a class="toclink" href="#templatehtmlrenderer">TemplateHTMLRenderer</a></h2>
639639
<p>Renders data to HTML, using Django's standard template rendering.
@@ -661,7 +661,7 @@ <h2 id="templatehtmlrenderer"><a class="toclink" href="#templatehtmlrenderer">Te
661661
<p>If you're building websites that use <code>TemplateHTMLRenderer</code> along with other renderer classes, you should consider listing <code>TemplateHTMLRenderer</code> as the first class in the <code>renderer_classes</code> list, so that it will be prioritised first even for browsers that send poorly formed <code>ACCEPT:</code> headers.</p>
662662
<p>See the <a href="../../topics/html-and-forms/"><em>HTML &amp; Forms</em> Topic Page</a> for further examples of <code>TemplateHTMLRenderer</code> usage.</p>
663663
<p><strong>.media_type</strong>: <code>text/html</code></p>
664-
<p><strong>.format</strong>: <code>'.html'</code></p>
664+
<p><strong>.format</strong>: <code>'html'</code></p>
665665
<p><strong>.charset</strong>: <code>utf-8</code></p>
666666
<p>See also: <code>StaticHTMLRenderer</code></p>
667667
<h2 id="statichtmlrenderer"><a class="toclink" href="#statichtmlrenderer">StaticHTMLRenderer</a></h2>
@@ -675,15 +675,15 @@ <h2 id="statichtmlrenderer"><a class="toclink" href="#statichtmlrenderer">Static
675675
</code></pre>
676676
<p>You can use <code>StaticHTMLRenderer</code> either to return regular HTML pages using REST framework, or to return both HTML and API responses from a single endpoint.</p>
677677
<p><strong>.media_type</strong>: <code>text/html</code></p>
678-
<p><strong>.format</strong>: <code>'.html'</code></p>
678+
<p><strong>.format</strong>: <code>'html'</code></p>
679679
<p><strong>.charset</strong>: <code>utf-8</code></p>
680680
<p>See also: <code>TemplateHTMLRenderer</code></p>
681681
<h2 id="browsableapirenderer"><a class="toclink" href="#browsableapirenderer">BrowsableAPIRenderer</a></h2>
682682
<p>Renders data into HTML for the Browsable API:</p>
683683
<p><img alt="The BrowsableAPIRenderer" src="../../img/quickstart.png" /></p>
684684
<p>This renderer will determine which other renderer would have been given highest priority, and use that to display an API style response within the HTML page.</p>
685685
<p><strong>.media_type</strong>: <code>text/html</code></p>
686-
<p><strong>.format</strong>: <code>'.api'</code></p>
686+
<p><strong>.format</strong>: <code>'api'</code></p>
687687
<p><strong>.charset</strong>: <code>utf-8</code></p>
688688
<p><strong>.template</strong>: <code>'rest_framework/api.html'</code></p>
689689
<h4 id="customizing-browsableapirenderer"><a class="toclink" href="#customizing-browsableapirenderer">Customizing BrowsableAPIRenderer</a></h4>
@@ -705,7 +705,7 @@ <h2 id="adminrenderer"><a class="toclink" href="#adminrenderer">AdminRenderer</a
705705
model = Account
706706
</code></pre>
707707
<p><strong>.media_type</strong>: <code>text/html</code></p>
708-
<p><strong>.format</strong>: <code>'.admin'</code></p>
708+
<p><strong>.format</strong>: <code>'admin'</code></p>
709709
<p><strong>.charset</strong>: <code>utf-8</code></p>
710710
<p><strong>.template</strong>: <code>'rest_framework/admin.html'</code></p>
711711
<h2 id="htmlformrenderer"><a class="toclink" href="#htmlformrenderer">HTMLFormRenderer</a></h2>
@@ -721,13 +721,13 @@ <h2 id="htmlformrenderer"><a class="toclink" href="#htmlformrenderer">HTMLFormRe
721721
</code></pre>
722722
<p>For more information see the <a href="../../topics/html-and-forms/">HTML &amp; Forms</a> documentation.</p>
723723
<p><strong>.media_type</strong>: <code>text/html</code></p>
724-
<p><strong>.format</strong>: <code>'.form'</code></p>
724+
<p><strong>.format</strong>: <code>'form'</code></p>
725725
<p><strong>.charset</strong>: <code>utf-8</code></p>
726726
<p><strong>.template</strong>: <code>'rest_framework/horizontal/form.html'</code></p>
727727
<h2 id="multipartrenderer"><a class="toclink" href="#multipartrenderer">MultiPartRenderer</a></h2>
728728
<p>This renderer is used for rendering HTML multipart form data. <strong>It is not suitable as a response renderer</strong>, but is instead used for creating test requests, using REST framework's <a href="../testing/">test client and test request factory</a>.</p>
729729
<p><strong>.media_type</strong>: <code>multipart/form-data; boundary=BoUnDaRyStRiNg</code></p>
730-
<p><strong>.format</strong>: <code>'.multipart'</code></p>
730+
<p><strong>.format</strong>: <code>'multipart'</code></p>
731731
<p><strong>.charset</strong>: <code>utf-8</code></p>
732732
<hr />
733733
<h1 id="custom-renderers"><a class="toclink" href="#custom-renderers">Custom renderers</a></h1>

api-guide/schemas/index.html

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -503,10 +503,6 @@ <h3 id="myModalLabel">Documentation search</h3>
503503
<a href="#drf-yasg-yet-another-swagger-generator">drf-yasg - Yet Another Swagger Generator</a>
504504
</li>
505505

506-
<li>
507-
<a href="#drf-openapi">DRF OpenAPI</a>
508-
</li>
509-
510506

511507

512508
<div class="promo">
@@ -619,8 +615,8 @@ <h2 id="schema-output-formats"><a class="toclink" href="#schema-output-formats">
619615
<p>REST framework includes a few different renderers that you can use for
620616
encoding the API schema.</p>
621617
<ul>
622-
<li><code>renderers.OpenAPIRenderer</code> - Renders into YAML-based [OpenAPI][openapi], the most widely used API schema format.</li>
623-
<li><code>renderers.JSONOpenAPIRenderer</code> - Renders into JSON-based [OpenAPI][openapi].</li>
618+
<li><code>renderers.OpenAPIRenderer</code> - Renders into YAML-based <a href="https://openapis.org/">OpenAPI</a>, the most widely used API schema format.</li>
619+
<li><code>renderers.JSONOpenAPIRenderer</code> - Renders into JSON-based <a href="https://openapis.org/">OpenAPI</a>.</li>
624620
<li><code>renderers.CoreJSONRenderer</code> - Renders into <a href="https://www.coreapi.org/specification/encoding/#core-json-encoding">Core JSON</a>, a format designed for
625621
use with the <code>coreapi</code> client library.</li>
626622
</ul>
@@ -1158,9 +1154,6 @@ <h1 id="third-party-packages"><a class="toclink" href="#third-party-packages">Th
11581154
<h2 id="drf-yasg-yet-another-swagger-generator"><a class="toclink" href="#drf-yasg-yet-another-swagger-generator">drf-yasg - Yet Another Swagger Generator</a></h2>
11591155
<p><a href="https://github.com/axnsan12/drf-yasg/">drf-yasg</a> generates <a href="https://openapis.org/">OpenAPI</a> documents suitable for code generation - nested schemas,
11601156
named models, response bodies, enum/pattern/min/max validators, form parameters, etc.</p>
1161-
<h2 id="drf-openapi"><a class="toclink" href="#drf-openapi">DRF OpenAPI</a></h2>
1162-
<p><a href="https://github.com/limdauto/drf_openapi">DRF OpenAPI</a> renders the schema generated by Django Rest Framework
1163-
in <a href="https://openapis.org/">OpenAPI</a> format.</p>
11641157

11651158

11661159
</div> <!--/span-->

api-guide/testing/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ <h1 id="requestsclient"><a class="toclink" href="#requestsclient">RequestsClient
694694
assert response.status_code == 200
695695
</code></pre>
696696
<p>Note that the requests client requires you to pass fully qualified URLs.</p>
697-
<h2 id="requestsclient-and-working-with-the-database"><a class="toclink" href="#requestsclient-and-working-with-the-database"><code>RequestsClient</code> and working with the database</a></h2>
697+
<h2 id="requestsclient-and-working-with-the-database"><a class="toclink" href="#requestsclient-and-working-with-the-database">RequestsClient and working with the database</a></h2>
698698
<p>The <code>RequestsClient</code> class is useful if you want to write tests that solely interact with the service interface. This is a little stricter than using the standard Django test client, as it means that all interactions should be via the API.</p>
699699
<p>If you're using <code>RequestsClient</code> you'll want to ensure that test setup, and results assertions are performed as regular API calls, rather than interacting with the database models directly. For example, rather than checking that <code>Customer.objects.count() == 3</code> you would list the customers endpoint, and ensure that it contains three records.</p>
700700
<h2 id="headers-authentication"><a class="toclink" href="#headers-authentication">Headers &amp; Authentication</a></h2>

community/3.0-announcement/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ <h1 id="django-rest-framework-30"><a class="toclink" href="#django-rest-framewor
465465
<p><strong>This release is incremental in nature. There <em>are</em> some breaking API changes, and upgrading <em>will</em> require you to read the release notes carefully, but the migration path should otherwise be relatively straightforward.</strong></p>
466466
<p>The difference in quality of the REST framework API and implementation should make writing, maintaining and debugging your application far easier.</p>
467467
<p>3.0 is the first of three releases that have been funded by our recent <a href="https://www.kickstarter.com/projects/tomchristie/django-rest-framework-3">Kickstarter campaign</a>.</p>
468-
<p>As ever, a huge thank you to our many <a href="https://www.django-rest-framework.org/topics/kickstarter-announcement/#sponsors">wonderful sponsors</a>. If you're looking for a Django gig, and want to work with smart community-minded folks, you should probably check out that list and see who's hiring.</p>
468+
<p>As ever, a huge thank you to our many <a href="https://www.django-rest-framework.org/community/kickstarter-announcement/#sponsors">wonderful sponsors</a>. If you're looking for a Django gig, and want to work with smart community-minded folks, you should probably check out that list and see who's hiring.</p>
469469
<hr />
470470
<h2 id="new-features"><a class="toclink" href="#new-features">New features</a></h2>
471471
<p>Notable features of this new release include:</p>

0 commit comments

Comments
 (0)