Skip to content

Commit dee977c

Browse files
committed
Deployed 761f56e with MkDocs version: 1.1
1 parent 0ecbb71 commit dee977c

File tree

20 files changed

+134
-214
lines changed

20 files changed

+134
-214
lines changed

api-guide/authentication/index.html

Lines changed: 15 additions & 15 deletions
Large diffs are not rendered by default.

api-guide/filtering/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ <h3 id="myModalLabel">Documentation search</h3>
472472
</li>
473473

474474
<li>
475-
<a href="#pagination-schemas">Pagination &amp; schemas</a>
475+
<a href="#filtering-schemas">Filtering &amp; schemas</a>
476476
</li>
477477

478478

@@ -767,7 +767,7 @@ <h2 id="customizing-the-interface"><a class="toclink" href="#customizing-the-int
767767
<p>Generic filters may also present an interface in the browsable API. To do so you should implement a <code>to_html()</code> method which returns a rendered HTML representation of the filter. This method should have the following signature:</p>
768768
<p><code>to_html(self, request, queryset, view)</code></p>
769769
<p>The method should return a rendered HTML string.</p>
770-
<h2 id="pagination-schemas"><a class="toclink" href="#pagination-schemas">Pagination &amp; schemas</a></h2>
770+
<h2 id="filtering-schemas"><a class="toclink" href="#filtering-schemas">Filtering &amp; schemas</a></h2>
771771
<p>You can also make the filter controls available to the schema autogeneration
772772
that REST framework provides, by implementing a <code>get_schema_fields()</code> method. This method should have the following signature:</p>
773773
<p><code>get_schema_fields(self, view)</code></p>

api-guide/pagination/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -666,10 +666,10 @@ <h4 id="configuration_2"><a class="toclink" href="#configuration_2">Configuratio
666666
</ul>
667667
<hr />
668668
<h1 id="custom-pagination-styles"><a class="toclink" href="#custom-pagination-styles">Custom pagination styles</a></h1>
669-
<p>To create a custom pagination serializer class you should subclass <code>pagination.BasePagination</code> and override the <code>paginate_queryset(self, queryset, request, view=None)</code> and <code>get_paginated_response(self, data)</code> methods:</p>
669+
<p>To create a custom pagination serializer class, you should inherit the subclass <code>pagination.BasePagination</code>, override the <code>paginate_queryset(self, queryset, request, view=None)</code>, and <code>get_paginated_response(self, data)</code> methods:</p>
670670
<ul>
671-
<li>The <code>paginate_queryset</code> method is passed the initial queryset and should return an iterable object that contains only the data in the requested page.</li>
672-
<li>The <code>get_paginated_response</code> method is passed the serialized page data and should return a <code>Response</code> instance.</li>
671+
<li>The <code>paginate_queryset</code> method is passed to the initial queryset and should return an iterable object. That object contains only the data in the requested page.</li>
672+
<li>The <code>get_paginated_response</code> method is passed to the serialized page data and should return a <code>Response</code> instance.</li>
673673
</ul>
674674
<p>Note that the <code>paginate_queryset</code> method may set state on the pagination instance, that may later be used by the <code>get_paginated_response</code> method.</p>
675675
<h2 id="example"><a class="toclink" href="#example">Example</a></h2>

api-guide/renderers/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ <h3 id="myModalLabel">Documentation search</h3>
573573
<h1 id="renderers"><a class="toclink" href="#renderers">Renderers</a></h1>
574574
<blockquote>
575575
<p>Before a TemplateResponse instance can be returned to the client, it must be rendered. The rendering process takes the intermediate representation of template and context, and turns it into the final byte stream that can be served to the client.</p>
576-
<p>&mdash; <a href="https://docs.djangoproject.com/en/stable/stable/template-response/#the-rendering-process">Django documentation</a></p>
576+
<p>&mdash; <a href="https://docs.djangoproject.com/en/stable/ref/template-response/#the-rendering-process">Django documentation</a></p>
577577
</blockquote>
578578
<p>REST framework includes a number of built in Renderer classes, that allow you to return responses with various media types. There is also support for defining your own custom renderers, which gives you the flexibility to design your own media types.</p>
579579
<h2 id="how-the-renderer-is-determined"><a class="toclink" href="#how-the-renderer-is-determined">How the renderer is determined</a></h2>
@@ -644,7 +644,7 @@ <h2 id="templatehtmlrenderer"><a class="toclink" href="#templatehtmlrenderer">Te
644644
Unlike other renderers, the data passed to the <code>Response</code> does not need to be serialized. Also, unlike other renderers, you may want to include a <code>template_name</code> argument when creating the <code>Response</code>.</p>
645645
<p>The TemplateHTMLRenderer will create a <code>RequestContext</code>, using the <code>response.data</code> as the context dict, and determine a template name to use to render the context.</p>
646646
<hr />
647-
<p><strong>Note:</strong> When used with a view that makes use of a serializer the <code>Response</code> sent for rendering may not be a dictionay and will need to be wrapped in a dict before returning to allow the TemplateHTMLRenderer to render it. For example:</p>
647+
<p><strong>Note:</strong> When used with a view that makes use of a serializer the <code>Response</code> sent for rendering may not be a dictionary and will need to be wrapped in a dict before returning to allow the TemplateHTMLRenderer to render it. For example:</p>
648648
<pre><code>response.data = {'results': response.data}
649649
</code></pre>
650650
<hr />

api-guide/schemas/index.html

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ <h3 id="myModalLabel">Documentation search</h3>
449449
<h1 id="schema"><a class="toclink" href="#schema">Schema</a></h1>
450450
<blockquote>
451451
<p>A machine-readable [schema] describes what resources are available via the API, what their URLs are, how they are represented and what operations they support.</p>
452-
<p>&mdash; Heroku, [JSON Schema for the Heroku Platform API][cite]</p>
452+
<p>&mdash; Heroku, <a href="https://blog.heroku.com/archives/2014/1/8/json_schema_for_heroku_platform_api">JSON Schema for the Heroku Platform API</a></p>
453453
</blockquote>
454454
<p>API schemas are a useful tool that allow for a range of use cases, including
455455
generating reference documentation, or driving dynamic client libraries that
@@ -738,6 +738,14 @@ <h4 id="get_operation_id_base"><a class="toclink" href="#get_operation_id_base">
738738
operationIds.</p>
739739
<p>In order to work around this, you can override <code>get_operation_id_base()</code> to
740740
provide a different base for name part of the ID.</p>
741+
<h4 id="get_serializer"><a class="toclink" href="#get_serializer"><code>get_serializer()</code></a></h4>
742+
<p>If the view has implemented <code>get_serializer()</code>, returns the result.</p>
743+
<h4 id="get_request_serializer"><a class="toclink" href="#get_request_serializer"><code>get_request_serializer()</code></a></h4>
744+
<p>By default returns <code>get_serializer()</code> but can be overridden to
745+
differentiate between request and response objects.</p>
746+
<h4 id="get_response_serializer"><a class="toclink" href="#get_response_serializer"><code>get_response_serializer()</code></a></h4>
747+
<p>By default returns <code>get_serializer()</code> but can be overridden to
748+
differentiate between request and response objects.</p>
741749
<h3 id="autoschema__init__-kwargs"><a class="toclink" href="#autoschema__init__-kwargs"><code>AutoSchema.__init__()</code> kwargs</a></h3>
742750
<p><code>AutoSchema</code> provides a number of <code>__init__()</code> kwargs that can be used for
743751
common customizations, if the default generated values are not appropriate.</p>

api-guide/serializers/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,10 +1109,10 @@ <h3 id="serializer_related_field"><a class="toclink" href="#serializer_related_f
11091109
<p>This property should be the serializer field class, that is used for relational fields by default.</p>
11101110
<p>For <code>ModelSerializer</code> this defaults to <code>PrimaryKeyRelatedField</code>.</p>
11111111
<p>For <code>HyperlinkedModelSerializer</code> this defaults to <code>serializers.HyperlinkedRelatedField</code>.</p>
1112-
<h3 id="serializer_url_field"><a class="toclink" href="#serializer_url_field"><code>serializer_url_field</code></a></h3>
1112+
<h3 id="serializer_url_field"><a class="toclink" href="#serializer_url_field"><code>.serializer_url_field</code></a></h3>
11131113
<p>The serializer field class that should be used for any <code>url</code> field on the serializer.</p>
11141114
<p>Defaults to <code>serializers.HyperlinkedIdentityField</code></p>
1115-
<h3 id="serializer_choice_field"><a class="toclink" href="#serializer_choice_field"><code>serializer_choice_field</code></a></h3>
1115+
<h3 id="serializer_choice_field"><a class="toclink" href="#serializer_choice_field"><code>.serializer_choice_field</code></a></h3>
11161116
<p>The serializer field class that should be used for any choice fields on the serializer.</p>
11171117
<p>Defaults to <code>serializers.ChoiceField</code></p>
11181118
<h3 id="the-field_class-and-field_kwargs-api"><a class="toclink" href="#the-field_class-and-field_kwargs-api">The field_class and field_kwargs API</a></h3>

api-guide/validators/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ <h2 id="updating-nested-serializers"><a class="toclink" href="#updating-nested-s
681681
<p>In the case of update operations on <em>nested</em> serializers there's no way of
682682
applying this exclusion, because the instance is not available.</p>
683683
<p>Again, you'll probably want to explicitly remove the validator from the
684-
serializer class, and write the code the for the validation constraint
684+
serializer class, and write the code for the validation constraint
685685
explicitly, in a <code>.validate()</code> method, or in the view.</p>
686686
<h2 id="debugging-complex-cases"><a class="toclink" href="#debugging-complex-cases">Debugging complex cases</a></h2>
687687
<p>If you're not sure exactly what behavior a <code>ModelSerializer</code> class will

community/contributing/index.html

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -517,10 +517,17 @@ <h1 id="development"><a class="toclink" href="#development">Development</a></h1>
517517
<a href="https://github.com/encode/django-rest-framework">Django REST Framework repo</a> on GitHub.</p>
518518
<p>Then clone your fork. The clone command will look like this, with your GitHub
519519
username instead of YOUR-USERNAME:</p>
520-
<pre><code>git clone https://github.com/YOUR-USERNAME/Spoon-Knife
520+
<pre><code>git clone https://github.com/YOUR-USERNAME/django-rest-framework
521521
</code></pre>
522522
<p>See GitHub's <a href="https://help.github.com/articles/fork-a-repo/"><em>Fork a Repo</em></a> Guide for more help.</p>
523-
<p>Changes should broadly follow the <a href="https://www.python.org/dev/peps/pep-0008/">PEP 8</a> style conventions, and we recommend you set up your editor to automatically indicate non-conforming styles.</p>
523+
<p>Changes should broadly follow the <a href="https://www.python.org/dev/peps/pep-0008/">PEP 8</a> style conventions, and we recommend you set up your editor to automatically indicate non-conforming styles.
524+
You can check your contributions against these conventions each time you commit using the <a href="https://pre-commit.com/">pre-commit</a> hooks, which we also run on CI.
525+
To set them up, first ensure you have the pre-commit tool installed, for example:</p>
526+
<pre><code>python -m pip install pre-commit
527+
</code></pre>
528+
<p>Then run:</p>
529+
<pre><code>pre-commit install
530+
</code></pre>
524531
<h2 id="testing"><a class="toclink" href="#testing">Testing</a></h2>
525532
<p>To run the tests, clone the repository, and then:</p>
526533
<pre><code># Setup the virtual environment
@@ -536,15 +543,6 @@ <h3 id="test-options"><a class="toclink" href="#test-options">Test options</a></
536543
<p>Run using a more concise output style.</p>
537544
<pre><code>./runtests.py -q
538545
</code></pre>
539-
<p>Run the tests using a more concise output style, no coverage, no flake8.</p>
540-
<pre><code>./runtests.py --fast
541-
</code></pre>
542-
<p>Don't run the flake8 code linting.</p>
543-
<pre><code>./runtests.py --nolint
544-
</code></pre>
545-
<p>Only run the flake8 code linting, don't run the tests.</p>
546-
<pre><code>./runtests.py --lintonly
547-
</code></pre>
548546
<p>Run the tests for a given test case.</p>
549547
<pre><code>./runtests.py MyTestCase
550548
</code></pre>
@@ -565,9 +563,9 @@ <h2 id="pull-requests"><a class="toclink" href="#pull-requests">Pull requests</a
565563
<p>It's also useful to remember that if you have an outstanding pull request then pushing new commits to your GitHub repo will also automatically update the pull requests.</p>
566564
<p>GitHub's documentation for working on pull requests is <a href="https://help.github.com/articles/using-pull-requests">available here</a>.</p>
567565
<p>Always run the tests before submitting pull requests, and ideally run <code>tox</code> in order to check that your modifications are compatible on all supported versions of Python and Django.</p>
568-
<p>Once you've made a pull request take a look at the Travis build status in the GitHub interface and make sure the tests are running as you'd expect.</p>
569-
<p><img alt="Travis status" src="../../img/travis-status.png" /></p>
570-
<p><em>Above: Travis build notifications</em></p>
566+
<p>Once you've made a pull request take a look at the build status in the GitHub interface and make sure the tests are running as you'd expect.</p>
567+
<p><img alt="Build status" src="../../img/build-status.png" /></p>
568+
<p><em>Above: build notifications</em></p>
571569
<h2 id="managing-compatibility-issues"><a class="toclink" href="#managing-compatibility-issues">Managing compatibility issues</a></h2>
572570
<p>Sometimes, in order to ensure your code works on various different versions of Django, Python or third party libraries, you'll need to run slightly different code depending on the environment. Any code that branches in this way should be isolated into the <code>compat.py</code> module, and should provide a single common interface that the rest of the codebase can use.</p>
573571
<h1 id="documentation"><a class="toclink" href="#documentation">Documentation</a></h1>

community/release-notes/index.html

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,12 @@ <h2 id="upgrading"><a class="toclink" href="#upgrading">Upgrading</a></h2>
517517
</code></pre>
518518
<hr />
519519
<h2 id="312x-series"><a class="toclink" href="#312x-series">3.12.x series</a></h2>
520-
<h3 id="3122"><a class="toclink" href="#3122">3.12.2</a></h3>
520+
<h3 id="3124"><a class="toclink" href="#3124">3.12.4</a></h3>
521+
<p>Date: 26th March 2021</p>
522+
<ul>
523+
<li>Revert use of <code>deque</code> instead of <code>list</code> for tracking throttling <code>.history</code>. (Due to incompatibility with DjangoRedis cache backend. See #7870) [#7872]</li>
524+
</ul>
525+
<h3 id="3123"><a class="toclink" href="#3123">3.12.3</a></h3>
521526
<p>Date: 25th March 2021</p>
522527
<ul>
523528
<li>Properly handle ATOMIC_REQUESTS when multiple database configurations are used. [#7739]</li>
@@ -532,7 +537,7 @@ <h3 id="3122"><a class="toclink" href="#3122">3.12.2</a></h3>
532537
<li>Don't include model properties as automatically generated ordering fields with <code>OrderingFilter</code>. [#7609]</li>
533538
<li>Use <code>deque</code> instead of <code>list</code> for tracking throttling <code>.history</code>. [#7849]</li>
534539
</ul>
535-
<h3 id="3122_1"><a class="toclink" href="#3122_1">3.12.2</a></h3>
540+
<h3 id="3122"><a class="toclink" href="#3122">3.12.2</a></h3>
536541
<p>Date: 13th October 2020</p>
537542
<ul>
538543
<li>Fix issue if <code>rest_framework.authtoken.models</code> is imported, but <code>rest_framework.authtoken</code> is not in INSTALLED_APPS. [#7571]</li>

0 commit comments

Comments
 (0)