Update documentation

This commit is contained in:
Tom Christie 2015-03-16 12:55:10 +00:00
parent 64c44bf357
commit 09d51ea4e2
4 changed files with 4 additions and 4 deletions

View File

@ -539,7 +539,7 @@ class StandardResultsSetPagination(PageNumberPagination):
}
</code></pre>
<h4 id="setup_1">Setup</h4>
<p>To enable the <code>PageNumberPagination</code> style globally, use the following configuration:</p>
<p>To enable the <code>LimitOffsetPagination</code> style globally, use the following configuration:</p>
<pre><code>REST_FRAMEWORK = {
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination'
}

View File

@ -498,7 +498,7 @@ request = factory.put('/notes/547/', content, content_type=content_type)
<h2 id="forcing-authentication">Forcing authentication</h2>
<p>When testing views directly using a request factory, it's often convenient to be able to directly authenticate the request, rather than having to construct the correct authentication credentials.</p>
<p>To forcibly authenticate a request, use the <code>force_authenticate()</code> method.</p>
<pre><code>from rest_framework.tests import force_authenticate
<pre><code>from rest_framework.test import force_authenticate
factory = APIRequestFactory()
user = User.objects.get(username='olivia')

View File

@ -496,7 +496,7 @@ Host: example.org
<hr />
<h2 id="modelserializer-api">ModelSerializer API</h2>
<p>The serializer redesign in 3.0 did not include any public API for modifying how ModelSerializer classes automatically generate a set of fields from a given mode class. We've now re-introduced an API for this, allowing you to create new ModelSerializer base classes that behave differently, such as using a different default style for relationships.</p>
<p>For more information, see the documentation on <a href="../../../api-guide/serializers.md/#customizing-field-mappings">customizing field mappings</a> for ModelSerializer classes.</p>
<p>For more information, see the documentation on <a href="../../api-guide/serializers#customizing-field-mappings">customizing field mappings</a> for ModelSerializer classes.</p>
<hr />
<h2 id="moving-packages-out-of-core">Moving packages out of core</h2>
<p>We've now moved a number of packages out of the core of REST framework, and into separately installable packages. If you're currently using these you don't need to worry, you simply need to <code>pip install</code> the new packages, and change any import paths.</p>

View File

@ -608,4 +608,4 @@ http --json POST http://127.0.0.1:8000/snippets/ code="print 456"
</script>
</body>
</html>
</html>