aboutsummaryrefslogtreecommitdiffstats
path: root/topics
diff options
context:
space:
mode:
authorTom Christie2015-03-06 12:05:16 +0000
committerTom Christie2015-03-06 12:05:16 +0000
commite628d9eb9b7deac2ecffe23eace5c72709887f8f (patch)
treedce4031c10381afca0631824eb741e135b78c160 /topics
parentccb2b8ff691760e4e93f3905975b285cee8b67f8 (diff)
downloaddjango-rest-framework-e628d9eb9b7deac2ecffe23eace5c72709887f8f.tar.bz2
Update documentation
Diffstat (limited to 'topics')
-rw-r--r--topics/2.2-announcement/index.html546
-rw-r--r--topics/2.3-announcement/index.html683
-rw-r--r--topics/3.0-announcement/index.html34
-rw-r--r--topics/3.1-announcement/index.html (renamed from topics/2.4-announcement/index.html)287
-rw-r--r--topics/ajax-csrf-cors/index.html30
-rw-r--r--topics/browsable-api/index.html28
-rw-r--r--topics/browser-enhancements/index.html28
-rw-r--r--topics/contributing/index.html28
-rw-r--r--topics/credits/index.html626
-rw-r--r--topics/documenting-your-api/index.html30
-rw-r--r--topics/internationalization/index.html (renamed from topics/rest-framework-2-announcement/index.html)198
-rw-r--r--topics/kickstarter-announcement/index.html30
-rw-r--r--topics/project-management/index.html83
-rw-r--r--topics/release-notes/index.html557
-rw-r--r--topics/rest-hypermedia-hateoas/index.html28
-rw-r--r--topics/third-party-resources/index.html29
16 files changed, 432 insertions, 2813 deletions
diff --git a/topics/2.2-announcement/index.html b/topics/2.2-announcement/index.html
deleted file mode 100644
index 2a19330b..00000000
--- a/topics/2.2-announcement/index.html
+++ /dev/null
@@ -1,546 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <meta charset="utf-8">
- <title>2.2 Announcement - Django REST framework</title>
- <link href="../../img/favicon.ico" rel="icon" type="image/x-icon">
- <link rel="canonical" href="http://www.django-rest-framework.org/topics/2.2-announcement/" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta name="description" content="Django, API, REST, 2.2 Announcement">
- <meta name="author" content="Tom Christie">
-
- <!-- Le styles -->
- <link href="../../css/prettify.css" rel="stylesheet">
- <link href="../../css/bootstrap.css" rel="stylesheet">
- <link href="../../css/bootstrap-responsive.css" rel="stylesheet">
- <link href="../../css/default.css" rel="stylesheet">
-
- <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
- <!--[if lt IE 9]>
- <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
- <![endif]-->
-
- <script type="text/javascript">
- var _gaq = _gaq || [];
- _gaq.push(['_setAccount', 'UA-18852272-2']);
- _gaq.push(['_trackPageview']);
-
- (function() {
- var ga = document.createElement('script');
- ga.type = 'text/javascript';
- ga.async = true;
- ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
- var s = document.getElementsByTagName('script')[0];
- s.parentNode.insertBefore(ga, s);
- })();
- </script>
-
- <style>
- span.fusion-wrap a {
- display: block;
- margin-top: 10px;
- color: black;
- }
- a.fusion-poweredby {
- display: block;
- margin-top: 10px;
- }
- @media (max-width: 767px) {
- div.promo {
- display: none;
- }
- }
- </style>
-</head>
-<body onload="prettyPrint()" class="-page">
-
- <div class="wrapper">
-
- <div class="navbar navbar-inverse navbar-fixed-top">
- <div class="navbar-inner">
- <div class="container-fluid">
- <a class="repo-link btn btn-primary btn-small" href="https://github.com/tomchristie/django-rest-framework/tree/master">GitHub</a>
- <a class="repo-link btn btn-inverse btn-small " rel="prev" href="../2.3-announcement">
- Next <i class="icon-arrow-right icon-white"></i>
- </a>
- <a class="repo-link btn btn-inverse btn-small " rel="next" href="../rest-framework-2-announcement">
- <i class="icon-arrow-left icon-white"></i> Previous
- </a>
- <a class="repo-link btn btn-inverse btn-small" href="#searchModal" data-toggle="modal"><i class="icon-search icon-white"></i> Search</a>
- <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- </a>
- <a class="brand" href="http://www.django-rest-framework.org">Django REST framework</a>
- <div class="nav-collapse collapse">
-
- <!-- Main navigation -->
- <ul class="nav navbar-nav">
- <li ><a href="/">Home</a></li>
-
- <li class="dropdown">
- <a href="#" class="dropdown-toggle" data-toggle="dropdown">Tutorial <b class="caret"></b></a>
- <ul class="dropdown-menu">
-
- <li >
- <a href="../../tutorial/quickstart">Quickstart</a>
- </li>
-
- <li >
- <a href="../../tutorial/1-serialization">1 - Serialization</a>
- </li>
-
- <li >
- <a href="../../tutorial/2-requests-and-responses">2 - Requests and responses</a>
- </li>
-
- <li >
- <a href="../../tutorial/3-class-based-views">3 - Class based views</a>
- </li>
-
- <li >
- <a href="../../tutorial/4-authentication-and-permissions">4 - Authentication and permissions</a>
- </li>
-
- <li >
- <a href="../../tutorial/5-relationships-and-hyperlinked-apis">5 - Relationships and hyperlinked APIs</a>
- </li>
-
- <li >
- <a href="../../tutorial/6-viewsets-and-routers">6 - Viewsets and routers</a>
- </li>
-
- </ul>
- </li>
-
- <li class="dropdown">
- <a href="#" class="dropdown-toggle" data-toggle="dropdown">API Guide <b class="caret"></b></a>
- <ul class="dropdown-menu">
-
- <li >
- <a href="../../api-guide/requests">Requests</a>
- </li>
-
- <li >
- <a href="../../api-guide/responses">Responses</a>
- </li>
-
- <li >
- <a href="../../api-guide/views">Views</a>
- </li>
-
- <li >
- <a href="../../api-guide/generic-views">Generic views</a>
- </li>
-
- <li >
- <a href="../../api-guide/viewsets">Viewsets</a>
- </li>
-
- <li >
- <a href="../../api-guide/routers">Routers</a>
- </li>
-
- <li >
- <a href="../../api-guide/parsers">Parsers</a>
- </li>
-
- <li >
- <a href="../../api-guide/renderers">Renderers</a>
- </li>
-
- <li >
- <a href="../../api-guide/serializers">Serializers</a>
- </li>
-
- <li >
- <a href="../../api-guide/fields">Serializer fields</a>
- </li>
-
- <li >
- <a href="../../api-guide/relations">Serializer relations</a>
- </li>
-
- <li >
- <a href="../../api-guide/validators">Validators</a>
- </li>
-
- <li >
- <a href="../../api-guide/authentication">Authentication</a>
- </li>
-
- <li >
- <a href="../../api-guide/permissions">Permissions</a>
- </li>
-
- <li >
- <a href="../../api-guide/throttling">Throttling</a>
- </li>
-
- <li >
- <a href="../../api-guide/filtering">Filtering</a>
- </li>
-
- <li >
- <a href="../../api-guide/pagination">Pagination</a>
- </li>
-
- <li >
- <a href="../../api-guide/content-negotiation">Content negotiation</a>
- </li>
-
- <li >
- <a href="../../api-guide/metadata">Metadata</a>
- </li>
-
- <li >
- <a href="../../api-guide/format-suffixes">Format suffixes</a>
- </li>
-
- <li >
- <a href="../../api-guide/reverse">Returning URLs</a>
- </li>
-
- <li >
- <a href="../../api-guide/exceptions">Exceptions</a>
- </li>
-
- <li >
- <a href="../../api-guide/status-codes">Status codes</a>
- </li>
-
- <li >
- <a href="../../api-guide/testing">Testing</a>
- </li>
-
- <li >
- <a href="../../api-guide/settings">Settings</a>
- </li>
-
- </ul>
- </li>
-
- <li class="dropdown active">
- <a href="#" class="dropdown-toggle" data-toggle="dropdown">Topics <b class="caret"></b></a>
- <ul class="dropdown-menu">
-
- <li >
- <a href="../documenting-your-api">Documenting your API</a>
- </li>
-
- <li >
- <a href="../ajax-csrf-cors">AJAX, CSRF & CORS</a>
- </li>
-
- <li >
- <a href="../browser-enhancements">Browser enhancements</a>
- </li>
-
- <li >
- <a href="../browsable-api">The Browsable API</a>
- </li>
-
- <li >
- <a href="../rest-hypermedia-hateoas">REST, Hypermedia & HATEOAS</a>
- </li>
-
- <li >
- <a href="../third-party-resources">Third Party Resources</a>
- </li>
-
- <li >
- <a href="../contributing">Contributing to REST framework</a>
- </li>
-
- <li >
- <a href="../project-management">Project management</a>
- </li>
-
- <li >
- <a href="../rest-framework-2-announcement">2.0 Announcement</a>
- </li>
-
- <li class="active" >
- <a href=".">2.2 Announcement</a>
- </li>
-
- <li >
- <a href="../2.3-announcement">2.3 Announcement</a>
- </li>
-
- <li >
- <a href="../2.4-announcement">2.4 Announcement</a>
- </li>
-
- <li >
- <a href="../3.0-announcement">3.0 Announcement</a>
- </li>
-
- <li >
- <a href="../kickstarter-announcement">Kickstarter Announcement</a>
- </li>
-
- <li >
- <a href="../release-notes">Release Notes</a>
- </li>
-
- <li >
- <a href="../credits">Credits</a>
- </li>
-
- </ul>
- </li>
-
-
- </ul>
-
- </div>
- <!--/.nav-collapse -->
-
- </div>
- </div>
- </div>
-
- <div class="body-content">
- <div class="container-fluid">
-
- <!-- Search Modal -->
- <div id="searchModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
- <h3 id="myModalLabel">Documentation search</h3>
- </div>
-
- <div class="modal-body">
- <!-- Custom google search -->
- <script>
- (function() {
- var cx = '015016005043623903336:rxraeohqk6w';
- var gcse = document.createElement('script');
- gcse.type = 'text/javascript';
- gcse.async = true;
- gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
- '//www.google.com/cse/cse.js?cx=' + cx;
- var s = document.getElementsByTagName('script')[0];
- s.parentNode.insertBefore(gcse, s);
- })();
- </script>
- <gcse:search></gcse:search>
- </div>
-
- <div class="modal-footer">
- <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
- </div>
- </div>
-
- <div class="row-fluid">
-
- <div class="span3">
- <!-- TODO
- <p style="margin-top: -12px">
- <a class="btn btn-mini btn-primary" style="width: 60px">&laquo; previous</a>
- <a class="btn btn-mini btn-primary" style="float: right; margin-right: 8px; width: 60px;">next &raquo;</a>
- </p>
- -->
- <div id="table-of-contents">
- <ul class="nav nav-list side-nav well sidebar-nav-fixed">
-
-
-
-
-
- <li class="main">
- <a href="#django-rest-framework-22">Django REST framework 2.2</a>
- </li>
-
-
- <li>
- <a href="#python-3-support">Python 3 support</a>
- </li>
-
- <li>
- <a href="#deprecation-policy">Deprecation policy</a>
- </li>
-
- <li>
- <a href="#community">Community</a>
- </li>
-
- <li>
- <a href="#api-changes">API changes</a>
- </li>
-
-
-
-
-
-
- </ul>
-
- </div>
- </div>
-
- <div id="main-content" class="span9">
-
-
- <h1 id="django-rest-framework-22">Django REST framework 2.2</h1>
-<p>The 2.2 release represents an important point for REST framework, with the addition of Python 3 support, and the introduction of an official deprecation policy.</p>
-<h2 id="python-3-support">Python 3 support</h2>
-<p>Thanks to some fantastic work from <a href="https://github.com/xordoquy">Xavier Ordoquy</a>, Django REST framework 2.2 now supports Python 3. You'll need to be running Django 1.5, and it's worth keeping in mind that Django's Python 3 support is currently <a href="https://docs.djangoproject.com/en/dev/faq/install/#can-i-use-django-with-python-3">considered experimental</a>.</p>
-<p>Django 1.6's Python 3 support is expected to be officially labeled as 'production-ready'.</p>
-<p>If you want to start ensuring that your own projects are Python 3 ready, we can highly recommend Django's <a href="https://docs.djangoproject.com/en/dev/topics/python3/">Porting to Python 3</a> documentation.</p>
-<p>Django REST framework's Python 2.6 support now requires 2.6.5 or above, in line with <a href="https://docs.djangoproject.com/en/dev/releases/1.5/#python-compatibility">Django 1.5's Python compatibility</a>.</p>
-<h2 id="deprecation-policy">Deprecation policy</h2>
-<p>We've now introduced an official deprecation policy, which is in line with <a href="https://docs.djangoproject.com/en/dev/internals/release-process/#internal-release-deprecation-policy">Django's deprecation policy</a>. This policy will make it easy for you to continue to track the latest, greatest version of REST framework.</p>
-<p>The timeline for deprecation works as follows:</p>
-<ul>
-<li>
-<p>Version 2.2 introduces some API changes as detailed in the release notes. It remains fully backwards compatible with 2.1, but will raise <code>PendingDeprecationWarning</code> warnings if you use bits of API that are due to be deprecated. These warnings are silent by default, but can be explicitly enabled when you're ready to start migrating any required changes. For example if you start running your tests using <code>python -Wd manage.py test</code>, you'll be warned of any API changes you need to make.</p>
-</li>
-<li>
-<p>Version 2.3 will escalate these warnings to <code>DeprecationWarning</code>, which is loud by default.</p>
-</li>
-<li>
-<p>Version 2.4 will remove the deprecated bits of API entirely.</p>
-</li>
-</ul>
-<p>Note that in line with Django's policy, any parts of the framework not mentioned in the documentation should generally be considered private API, and may be subject to change.</p>
-<h2 id="community">Community</h2>
-<p>As of the 2.2 merge, we've also hit an impressive milestone. The number of committers listed in <a href="http://www.django-rest-framework.org/topics/credits">the credits</a>, is now at over <strong>one hundred individuals</strong>. Each name on that list represents at least one merged pull request, however large or small.</p>
-<p>Our <a href="https://groups.google.com/forum/?fromgroups#!forum/django-rest-framework">mailing list</a> and #restframework IRC channel are also very active, and we've got a really impressive rate of development both on REST framework itself, and on third party packages such as the great <a href="https://github.com/marcgibbons/django-rest-framework-docs">django-rest-framework-docs</a> package from <a href="https://github.com/marcgibbons/">Marc Gibbons</a>.</p>
-<hr />
-<h2 id="api-changes">API changes</h2>
-<p>The 2.2 release makes a few changes to the API, in order to make it more consistent, simple, and easier to use.</p>
-<h3 id="cleaner-to-many-related-fields">Cleaner to-many related fields</h3>
-<p>The <code>ManyRelatedField()</code> style is being deprecated in favor of a new <code>RelatedField(many=True)</code> syntax.</p>
-<p>For example, if a user is associated with multiple questions, which we want to represent using a primary key relationship, we might use something like the following:</p>
-<pre><code>class UserSerializer(serializers.HyperlinkedModelSerializer):
- questions = serializers.PrimaryKeyRelatedField(many=True)
-
- class Meta:
- fields = ('username', 'questions')
-</code></pre>
-<p>The new syntax is cleaner and more obvious, and the change will also make the documentation cleaner, simplify the internal API, and make writing custom relational fields easier.</p>
-<p>The change also applies to serializers. If you have a nested serializer, you should start using <code>many=True</code> for to-many relationships. For example, a serializer representation of an Album that can contain many Tracks might look something like this:</p>
-<pre><code>class TrackSerializer(serializer.ModelSerializer):
- class Meta:
- model = Track
- fields = ('name', 'duration')
-
-class AlbumSerializer(serializer.ModelSerializer):
- tracks = TrackSerializer(many=True)
-
- class Meta:
- model = Album
- fields = ('album_name', 'artist', 'tracks')
-</code></pre>
-<p>Additionally, the change also applies when serializing or deserializing data. For example to serialize a queryset of models you should now use the <code>many=True</code> flag.</p>
-<pre><code>serializer = SnippetSerializer(Snippet.objects.all(), many=True)
-serializer.data
-</code></pre>
-<p>This more explicit behavior on serializing and deserializing data <a href="https://github.com/tomchristie/django-rest-framework/issues/564">makes integration with non-ORM backends such as MongoDB easier</a>, as instances to be serialized can include the <code>__iter__</code> method, without incorrectly triggering list-based serialization, or requiring workarounds.</p>
-<p>The implicit to-many behavior on serializers, and the <code>ManyRelatedField</code> style classes will continue to function, but will raise a <code>PendingDeprecationWarning</code>, which can be made visible using the <code>-Wd</code> flag.</p>
-<p><strong>Note</strong>: If you need to forcibly turn off the implicit "<code>many=True</code> for <code>__iter__</code> objects" behavior, you can now do so by specifying <code>many=False</code>. This will become the default (instead of the current default of <code>None</code>) once the deprecation of the implicit behavior is finalised in version 2.4.</p>
-<h3 id="cleaner-optional-relationships">Cleaner optional relationships</h3>
-<p>Serializer relationships for nullable Foreign Keys will change from using the current <code>null=True</code> flag, to instead using <code>required=False</code>.</p>
-<p>For example, is a user account has an optional foreign key to a company, that you want to express using a hyperlink, you might use the following field in a <code>Serializer</code> class:</p>
-<pre><code>current_company = serializers.HyperlinkedRelatedField(required=False)
-</code></pre>
-<p>This is in line both with the rest of the serializer fields API, and with Django's <code>Form</code> and <code>ModelForm</code> API.</p>
-<p>Using <code>required</code> throughout the serializers API means you won't need to consider if a particular field should take <code>blank</code> or <code>null</code> arguments instead of <code>required</code>, and also means there will be more consistent behavior for how fields are treated when they are not present in the incoming data.</p>
-<p>The <code>null=True</code> argument will continue to function, and will imply <code>required=False</code>, but will raise a <code>PendingDeprecationWarning</code>.</p>
-<h3 id="cleaner-charfield-syntax">Cleaner CharField syntax</h3>
-<p>The <code>CharField</code> API previously took an optional <code>blank=True</code> argument, which was intended to differentiate between null CharField input, and blank CharField input.</p>
-<p>In keeping with Django's CharField API, REST framework's <code>CharField</code> will only ever return the empty string, for missing or <code>None</code> inputs. The <code>blank</code> flag will no longer be in use, and you should instead just use the <code>required=&lt;bool&gt;</code> flag. For example:</p>
-<pre><code>extra_details = CharField(required=False)
-</code></pre>
-<p>The <code>blank</code> keyword argument will continue to function, but will raise a <code>PendingDeprecationWarning</code>.</p>
-<h3 id="simpler-object-level-permissions">Simpler object-level permissions</h3>
-<p>Custom permissions classes previously used the signature <code>.has_permission(self, request, view, obj=None)</code>. This method would be called twice, firstly for the global permissions check, with the <code>obj</code> parameter set to <code>None</code>, and again for the object-level permissions check when appropriate, with the <code>obj</code> parameter set to the relevant model instance.</p>
-<p>The global permissions check and object-level permissions check are now separated into two separate methods, which gives a cleaner, more obvious API.</p>
-<ul>
-<li>Global permission checks now use the <code>.has_permission(self, request, view)</code> signature.</li>
-<li>Object-level permission checks use a new method <code>.has_object_permission(self, request, view, obj)</code>.</li>
-</ul>
-<p>For example, the following custom permission class:</p>
-<pre><code>class IsOwner(permissions.BasePermission):
- """
- Custom permission to only allow owners of an object to view or edit it.
- Model instances are expected to include an `owner` attribute.
- """
-
- def has_permission(self, request, view, obj=None):
- if obj is None:
- # Ignore global permissions check
- return True
-
- return obj.owner == request.user
-</code></pre>
-<p>Now becomes:</p>
-<pre><code>class IsOwner(permissions.BasePermission):
- """
- Custom permission to only allow owners of an object to view or edit it.
- Model instances are expected to include an `owner` attribute.
- """
-
- def has_object_permission(self, request, view, obj):
- return obj.owner == request.user
-</code></pre>
-<p>If you're overriding the <code>BasePermission</code> class, the old-style signature will continue to function, and will correctly handle both global and object-level permissions checks, but its use will raise a <code>PendingDeprecationWarning</code>.</p>
-<p>Note also that the usage of the internal APIs for permission checking on the <code>View</code> class has been cleaned up slightly, and is now documented and subject to the deprecation policy in all future versions.</p>
-<h3 id="more-explicit-hyperlink-relations-behavior">More explicit hyperlink relations behavior</h3>
-<p>When using a serializer with a <code>HyperlinkedRelatedField</code> or <code>HyperlinkedIdentityField</code>, the hyperlinks would previously use absolute URLs if the serializer context included a <code>'request'</code> key, and fall back to using relative URLs otherwise. This could lead to non-obvious behavior, as it might not be clear why some serializers generated absolute URLs, and others do not.</p>
-<p>From version 2.2 onwards, serializers with hyperlinked relationships <em>always</em> require a <code>'request'</code> key to be supplied in the context dictionary. The implicit behavior will continue to function, but its use will raise a <code>PendingDeprecationWarning</code>.</p>
-
- </div>
- <!--/span-->
- </div>
- <!--/row-->
- </div>
- <!--/.fluid-container-->
- </div>
- <!--/.body content-->
- <div id="push"></div>
- </div>
- <!--/.wrapper -->
-
- <footer class="span12">
- <p>Documentation built with <a href="http://www.mkdocs.org/">MkDocs</a>.</a>
- </p>
- </footer>
-
- <!-- Le javascript
- ================================================== -->
- <!-- Placed at the end of the document so the pages load faster -->
- <script src="../../js/jquery-1.8.1-min.js"></script>
- <script src="../../js/prettify-1.0.js"></script>
- <script src="../../js/bootstrap-2.1.1-min.js"></script>
- <script src="../../js/theme.js"></script>
-
- <script>
- //$('.side-nav').scrollspy()
- var shiftWindow = function() {
- scrollBy(0, -50)
- };
- if (location.hash) shiftWindow();
- window.addEventListener("hashchange", shiftWindow);
-
- $('.dropdown-menu').on('click touchstart', function(event) {
- event.stopPropagation();
- });
-
- // Dynamically force sidenav to no higher than browser window
- $('.side-nav').css('max-height', window.innerHeight - 130);
-
- $(function() {
- $(window).resize(function() {
- $('.side-nav').css('max-height', window.innerHeight - 130);
- });
- });
- </script>
-</body>
-
-</html> \ No newline at end of file
diff --git a/topics/2.3-announcement/index.html b/topics/2.3-announcement/index.html
deleted file mode 100644
index eb6b8728..00000000
--- a/topics/2.3-announcement/index.html
+++ /dev/null
@@ -1,683 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <meta charset="utf-8">
- <title>2.3 Announcement - Django REST framework</title>
- <link href="../../img/favicon.ico" rel="icon" type="image/x-icon">
- <link rel="canonical" href="http://www.django-rest-framework.org/topics/2.3-announcement/" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta name="description" content="Django, API, REST, 2.3 Announcement">
- <meta name="author" content="Tom Christie">
-
- <!-- Le styles -->
- <link href="../../css/prettify.css" rel="stylesheet">
- <link href="../../css/bootstrap.css" rel="stylesheet">
- <link href="../../css/bootstrap-responsive.css" rel="stylesheet">
- <link href="../../css/default.css" rel="stylesheet">
-
- <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
- <!--[if lt IE 9]>
- <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
- <![endif]-->
-
- <script type="text/javascript">
- var _gaq = _gaq || [];
- _gaq.push(['_setAccount', 'UA-18852272-2']);
- _gaq.push(['_trackPageview']);
-
- (function() {
- var ga = document.createElement('script');
- ga.type = 'text/javascript';
- ga.async = true;
- ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
- var s = document.getElementsByTagName('script')[0];
- s.parentNode.insertBefore(ga, s);
- })();
- </script>
-
- <style>
- span.fusion-wrap a {
- display: block;
- margin-top: 10px;
- color: black;
- }
- a.fusion-poweredby {
- display: block;
- margin-top: 10px;
- }
- @media (max-width: 767px) {
- div.promo {
- display: none;
- }
- }
- </style>
-</head>
-<body onload="prettyPrint()" class="-page">
-
- <div class="wrapper">
-
- <div class="navbar navbar-inverse navbar-fixed-top">
- <div class="navbar-inner">
- <div class="container-fluid">
- <a class="repo-link btn btn-primary btn-small" href="https://github.com/tomchristie/django-rest-framework/tree/master">GitHub</a>
- <a class="repo-link btn btn-inverse btn-small " rel="prev" href="../2.4-announcement">
- Next <i class="icon-arrow-right icon-white"></i>
- </a>
- <a class="repo-link btn btn-inverse btn-small " rel="next" href="../2.2-announcement">
- <i class="icon-arrow-left icon-white"></i> Previous
- </a>
- <a class="repo-link btn btn-inverse btn-small" href="#searchModal" data-toggle="modal"><i class="icon-search icon-white"></i> Search</a>
- <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- </a>
- <a class="brand" href="http://www.django-rest-framework.org">Django REST framework</a>
- <div class="nav-collapse collapse">
-
- <!-- Main navigation -->
- <ul class="nav navbar-nav">
- <li ><a href="/">Home</a></li>
-
- <li class="dropdown">
- <a href="#" class="dropdown-toggle" data-toggle="dropdown">Tutorial <b class="caret"></b></a>
- <ul class="dropdown-menu">
-
- <li >
- <a href="../../tutorial/quickstart">Quickstart</a>
- </li>
-
- <li >
- <a href="../../tutorial/1-serialization">1 - Serialization</a>
- </li>
-
- <li >
- <a href="../../tutorial/2-requests-and-responses">2 - Requests and responses</a>
- </li>
-
- <li >
- <a href="../../tutorial/3-class-based-views">3 - Class based views</a>
- </li>
-
- <li >
- <a href="../../tutorial/4-authentication-and-permissions">4 - Authentication and permissions</a>
- </li>
-
- <li >
- <a href="../../tutorial/5-relationships-and-hyperlinked-apis">5 - Relationships and hyperlinked APIs</a>
- </li>
-
- <li >
- <a href="../../tutorial/6-viewsets-and-routers">6 - Viewsets and routers</a>
- </li>
-
- </ul>
- </li>
-
- <li class="dropdown">
- <a href="#" class="dropdown-toggle" data-toggle="dropdown">API Guide <b class="caret"></b></a>
- <ul class="dropdown-menu">
-
- <li >
- <a href="../../api-guide/requests">Requests</a>
- </li>
-
- <li >
- <a href="../../api-guide/responses">Responses</a>
- </li>
-
- <li >
- <a href="../../api-guide/views">Views</a>
- </li>
-
- <li >
- <a href="../../api-guide/generic-views">Generic views</a>
- </li>
-
- <li >
- <a href="../../api-guide/viewsets">Viewsets</a>
- </li>
-
- <li >
- <a href="../../api-guide/routers">Routers</a>
- </li>
-
- <li >
- <a href="../../api-guide/parsers">Parsers</a>
- </li>
-
- <li >
- <a href="../../api-guide/renderers">Renderers</a>
- </li>
-
- <li >
- <a href="../../api-guide/serializers">Serializers</a>
- </li>
-
- <li >
- <a href="../../api-guide/fields">Serializer fields</a>
- </li>
-
- <li >
- <a href="../../api-guide/relations">Serializer relations</a>
- </li>
-
- <li >
- <a href="../../api-guide/validators">Validators</a>
- </li>
-
- <li >
- <a href="../../api-guide/authentication">Authentication</a>
- </li>
-
- <li >
- <a href="../../api-guide/permissions">Permissions</a>
- </li>
-
- <li >
- <a href="../../api-guide/throttling">Throttling</a>
- </li>
-
- <li >
- <a href="../../api-guide/filtering">Filtering</a>
- </li>
-
- <li >
- <a href="../../api-guide/pagination">Pagination</a>
- </li>
-
- <li >
- <a href="../../api-guide/content-negotiation">Content negotiation</a>
- </li>
-
- <li >
- <a href="../../api-guide/metadata">Metadata</a>
- </li>
-
- <li >
- <a href="../../api-guide/format-suffixes">Format suffixes</a>
- </li>
-
- <li >
- <a href="../../api-guide/reverse">Returning URLs</a>
- </li>
-
- <li >
- <a href="../../api-guide/exceptions">Exceptions</a>
- </li>
-
- <li >
- <a href="../../api-guide/status-codes">Status codes</a>
- </li>
-
- <li >
- <a href="../../api-guide/testing">Testing</a>
- </li>
-
- <li >
- <a href="../../api-guide/settings">Settings</a>
- </li>
-
- </ul>
- </li>
-
- <li class="dropdown active">
- <a href="#" class="dropdown-toggle" data-toggle="dropdown">Topics <b class="caret"></b></a>
- <ul class="dropdown-menu">
-
- <li >
- <a href="../documenting-your-api">Documenting your API</a>
- </li>
-
- <li >
- <a href="../ajax-csrf-cors">AJAX, CSRF & CORS</a>
- </li>
-
- <li >
- <a href="../browser-enhancements">Browser enhancements</a>
- </li>
-
- <li >
- <a href="../browsable-api">The Browsable API</a>
- </li>
-
- <li >
- <a href="../rest-hypermedia-hateoas">REST, Hypermedia & HATEOAS</a>
- </li>
-
- <li >
- <a href="../third-party-resources">Third Party Resources</a>
- </li>
-
- <li >
- <a href="../contributing">Contributing to REST framework</a>
- </li>
-
- <li >
- <a href="../project-management">Project management</a>
- </li>
-
- <li >
- <a href="../rest-framework-2-announcement">2.0 Announcement</a>
- </li>
-
- <li >
- <a href="../2.2-announcement">2.2 Announcement</a>
- </li>
-
- <li class="active" >
- <a href=".">2.3 Announcement</a>
- </li>
-
- <li >
- <a href="../2.4-announcement">2.4 Announcement</a>
- </li>
-
- <li >
- <a href="../3.0-announcement">3.0 Announcement</a>
- </li>
-
- <li >
- <a href="../kickstarter-announcement">Kickstarter Announcement</a>
- </li>
-
- <li >
- <a href="../release-notes">Release Notes</a>
- </li>
-
- <li >
- <a href="../credits">Credits</a>
- </li>
-
- </ul>
- </li>
-
-
- </ul>
-
- </div>
- <!--/.nav-collapse -->
-
- </div>
- </div>
- </div>
-
- <div class="body-content">
- <div class="container-fluid">
-
- <!-- Search Modal -->
- <div id="searchModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
- <h3 id="myModalLabel">Documentation search</h3>
- </div>
-
- <div class="modal-body">
- <!-- Custom google search -->
- <script>
- (function() {
- var cx = '015016005043623903336:rxraeohqk6w';
- var gcse = document.createElement('script');
- gcse.type = 'text/javascript';
- gcse.async = true;
- gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
- '//www.google.com/cse/cse.js?cx=' + cx;
- var s = document.getElementsByTagName('script')[0];
- s.parentNode.insertBefore(gcse, s);
- })();
- </script>
- <gcse:search></gcse:search>
- </div>
-
- <div class="modal-footer">
- <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
- </div>
- </div>
-
- <div class="row-fluid">
-
- <div class="span3">
- <!-- TODO
- <p style="margin-top: -12px">
- <a class="btn btn-mini btn-primary" style="width: 60px">&laquo; previous</a>
- <a class="btn btn-mini btn-primary" style="float: right; margin-right: 8px; width: 60px;">next &raquo;</a>
- </p>
- -->
- <div id="table-of-contents">
- <ul class="nav nav-list side-nav well sidebar-nav-fixed">
-
-
-
-
-
- <li class="main">
- <a href="#django-rest-framework-23">Django REST framework 2.3</a>
- </li>
-
-
- <li>
- <a href="#viewsets-and-routers">ViewSets and Routers</a>
- </li>
-
- <li>
- <a href="#simpler-views">Simpler views</a>
- </li>
-
- <li>
- <a href="#easier-serializers">Easier Serializers</a>
- </li>
-
- <li>
- <a href="#more-flexible-filtering">More flexible filtering</a>
- </li>
-
-
-
-
- <li class="main">
- <a href="#api-changes">API Changes</a>
- </li>
-
-
- <li>
- <a href="#simplified-generic-view-classes">Simplified generic view classes</a>
- </li>
-
- <li>
- <a href="#simpler-url-lookups">Simpler URL lookups</a>
- </li>
-
- <li>
- <a href="#fileuploadparser">FileUploadParser</a>
- </li>
-
- <li>
- <a href="#decimalfield">DecimalField</a>
- </li>
-
- <li>
- <a href="#modelserializers-and-reverse-relationships">ModelSerializers and reverse relationships</a>
- </li>
-
- <li>
- <a href="#view-names-and-descriptions">View names and descriptions</a>
- </li>
-
-
-
-
- <li class="main">
- <a href="#other-notes">Other notes</a>
- </li>
-
-
- <li>
- <a href="#more-explicit-style">More explicit style</a>
- </li>
-
- <li>
- <a href="#django-13-support">Django 1.3 support</a>
- </li>
-
- <li>
- <a href="#version-22-api-changes">Version 2.2 API changes</a>
- </li>
-
- <li>
- <a href="#what-comes-next">What comes next?</a>
- </li>
-
-
-
-
-
-
- </ul>
-
- </div>
- </div>
-
- <div id="main-content" class="span9">
-
-
- <h1 id="django-rest-framework-23">Django REST framework 2.3</h1>
-<p>REST framework 2.3 makes it even quicker and easier to build your Web APIs.</p>
-<h2 id="viewsets-and-routers">ViewSets and Routers</h2>
-<p>The 2.3 release introduces the <a href="../../api-guide/viewsets">ViewSet</a> and <a href="../../api-guide/routers">Router</a> classes.</p>
-<p>A viewset is simply a type of class based view that allows you to group multiple views into a single common class.</p>
-<p>Routers allow you to automatically determine the URLconf for your viewset classes.</p>
-<p>As an example of just how simple REST framework APIs can now be, here's an API written in a single <code>urls.py</code> module:</p>
-<pre><code>"""
-A REST framework API for viewing and editing users and groups.
-"""
-from django.conf.urls.defaults import url, include
-from django.contrib.auth.models import User, Group
-from rest_framework import viewsets, routers
-
-
-# ViewSets define the view behavior.
-class UserViewSet(viewsets.ModelViewSet):
- model = User
-
-class GroupViewSet(viewsets.ModelViewSet):
- model = Group
-
-
-# Routers provide an easy way of automatically determining the URL conf
-router = routers.DefaultRouter()
-router.register(r'users', UserViewSet)
-router.register(r'groups', GroupViewSet)
-
-
-# Wire up our API using automatic URL routing.
-# Additionally, we include login URLs for the browsable API.
-urlpatterns = [
- url(r'^', include(router.urls)),
- url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework'))
-]
-</code></pre>
-<p>The best place to get started with ViewSets and Routers is to take a look at the <a href="../../tutorial/6-viewsets-and-routers">newest section in the tutorial</a>, which demonstrates their usage.</p>
-<h2 id="simpler-views">Simpler views</h2>
-<p>This release rationalises the API and implementation of the generic views, dropping the dependency on Django's <code>SingleObjectMixin</code> and <code>MultipleObjectMixin</code> classes, removing a number of unneeded attributes, and generally making the implementation more obvious and easy to work with.</p>
-<p>This improvement is reflected in improved documentation for the <code>GenericAPIView</code> base class, and should make it easier to determine how to override methods on the base class if you need to write customized subclasses.</p>
-<h2 id="easier-serializers">Easier Serializers</h2>
-<p>REST framework lets you be totally explicit regarding how you want to represent relationships, allowing you to choose between styles such as hyperlinking or primary key relationships.</p>
-<p>The ability to specify exactly how you want to represent relationships is powerful, but it also introduces complexity. In order to keep things more simple, REST framework now allows you to include reverse relationships simply by including the field name in the <code>fields</code> metadata of the serializer class.</p>
-<p>For example, in REST framework 2.2, reverse relationships needed to be included explicitly on a serializer class.</p>
-<pre><code>class BlogSerializer(serializers.ModelSerializer):
- comments = serializers.PrimaryKeyRelatedField(many=True)
-
- class Meta:
- model = Blog
- fields = ('id', 'title', 'created', 'comments')
-</code></pre>
-<p>As of 2.3, you can simply include the field name, and the appropriate serializer field will automatically be used for the relationship.</p>
-<pre><code>class BlogSerializer(serializers.ModelSerializer):
- """
- Don't need to specify the 'comments' field explicitly anymore.
- """
- class Meta:
- model = Blog
- fields = ('id', 'title', 'created', 'comments')
-</code></pre>
-<p>Similarly, you can now easily include the primary key in hyperlinked relationships, simply by adding the field name to the metadata.</p>
-<pre><code>class BlogSerializer(serializers.HyperlinkedModelSerializer):
- """
- This is a hyperlinked serializer, which default to using
- a field named 'url' as the primary identifier.
- Note that we can now easily also add in the 'id' field.
- """
- class Meta:
- model = Blog
- fields = ('url', 'id', 'title', 'created', 'comments')
-</code></pre>
-<h2 id="more-flexible-filtering">More flexible filtering</h2>
-<p>The <code>FILTER_BACKEND</code> setting has moved to pending deprecation, in favor of a <code>DEFAULT_FILTER_BACKENDS</code> setting that takes a <em>list</em> of filter backend classes, instead of a single filter backend class.</p>
-<p>The generic view <code>filter_backend</code> attribute has also been moved to pending deprecation in favor of a <code>filter_backends</code> setting.</p>
-<p>Being able to specify multiple filters will allow for more flexible, powerful behavior. New filter classes to handle searching and ordering of results are planned to be released shortly.</p>
-<hr />
-<h1 id="api-changes">API Changes</h1>
-<h2 id="simplified-generic-view-classes">Simplified generic view classes</h2>
-<p>The functionality provided by <code>SingleObjectAPIView</code> and <code>MultipleObjectAPIView</code> base classes has now been moved into the base class <code>GenericAPIView</code>. The implementation of this base class is simple enough that providing subclasses for the base classes of detail and list views is somewhat unnecessary.</p>
-<p>Additionally the base generic view no longer inherits from Django's <code>SingleObjectMixin</code> or <code>MultipleObjectMixin</code> classes, simplifying the implementation, and meaning you don't need to cross-reference across to Django's codebase.</p>
-<p>Using the <code>SingleObjectAPIView</code> and <code>MultipleObjectAPIView</code> base classes continues to be supported, but will raise a <code>PendingDeprecationWarning</code>. You should instead simply use <code>GenericAPIView</code> as the base for any generic view subclasses.</p>
-<h3 id="removed-attributes">Removed attributes</h3>
-<p>The following attributes and methods, were previously present as part of Django's generic view implementations, but were unneeded and unused and have now been entirely removed.</p>
-<ul>
-<li>context_object_name</li>
-<li>get_context_data()</li>
-<li>get_context_object_name()</li>
-</ul>
-<p>The following attributes and methods, which were previously present as part of Django's generic view implementations have also been entirely removed.</p>
-<ul>
-<li>paginator_class</li>
-<li>get_paginator()</li>
-<li>get_allow_empty()</li>
-<li>get_slug_field()</li>
-</ul>
-<p>There may be cases when removing these bits of API might mean you need to write a little more code if your view has highly customized behavior, but generally we believe that providing a coarser-grained API will make the views easier to work with, and is the right trade-off to make for the vast majority of cases.</p>
-<p>Note that the listed attributes and methods have never been a documented part of the REST framework API, and as such are not covered by the deprecation policy.</p>
-<h3 id="simplified-methods">Simplified methods</h3>
-<p>The <code>get_object</code> and <code>get_paginate_by</code> methods no longer take an optional queryset argument. This makes overridden these methods more obvious, and a little more simple.</p>
-<p>Using an optional queryset with these methods continues to be supported, but will raise a <code>PendingDeprecationWarning</code>.</p>
-<p>The <code>paginate_queryset</code> method no longer takes a <code>page_size</code> argument, or returns a four-tuple of pagination information. Instead it simply takes a queryset argument, and either returns a <code>page</code> object with an appropriate page size, or returns <code>None</code>, if pagination is not configured for the view.</p>
-<p>Using the <code>page_size</code> argument is still supported and will trigger the old-style return type, but will raise a <code>PendingDeprecationWarning</code>.</p>
-<h3 id="deprecated-attributes">Deprecated attributes</h3>
-<p>The following attributes are used to control queryset lookup, and have all been moved into a pending deprecation state.</p>
-<ul>
-<li>pk_url_kwarg = 'pk'</li>
-<li>slug_url_kwarg = 'slug'</li>
-<li>slug_field = 'slug'</li>
-</ul>
-<p>Their usage is replaced with a single attribute:</p>
-<ul>
-<li>lookup_field = 'pk'</li>
-</ul>
-<p>This attribute is used both as the regex keyword argument in the URL conf, and as the model field to filter against when looking up a model instance. To use non-pk based lookup, simply set the <code>lookup_field</code> argument to an alternative field, and ensure that the keyword argument in the url conf matches the field name.</p>
-<p>For example, a view with 'username' based lookup might look like this:</p>
-<pre><code>class UserDetail(generics.RetrieveAPIView):
- lookup_field = 'username'
- queryset = User.objects.all()
- serializer_class = UserSerializer
-</code></pre>
-<p>And would have the following entry in the urlconf:</p>
-<pre><code> url(r'^users/(?P&lt;username&gt;\w+)/$', UserDetail.as_view()),
-</code></pre>
-<p>Usage of the old-style attributes continues to be supported, but will raise a <code>PendingDeprecationWarning</code>.</p>
-<p>The <code>allow_empty</code> attribute is also deprecated. To use <code>allow_empty=False</code> style behavior you should explicitly override <code>get_queryset</code> and raise an <code>Http404</code> on empty querysets.</p>
-<p>For example:</p>
-<pre><code>class DisallowEmptyQuerysetMixin(object):
- def get_queryset(self):
- queryset = super(DisallowEmptyQuerysetMixin, self).get_queryset()
- if not queryset.exists():
- raise Http404
- return queryset
-</code></pre>
-<p>In our opinion removing lesser-used attributes like <code>allow_empty</code> helps us move towards simpler generic view implementations, making them more obvious to use and override, and re-enforcing the preferred style of developers writing their own base classes and mixins for custom behavior rather than relying on the configurability of the generic views.</p>
-<h2 id="simpler-url-lookups">Simpler URL lookups</h2>
-<p>The <code>HyperlinkedRelatedField</code> class now takes a single optional <code>lookup_field</code> argument, that replaces the <code>pk_url_kwarg</code>, <code>slug_url_kwarg</code>, and <code>slug_field</code> arguments.</p>
-<p>For example, you might have a field that references it's relationship by a hyperlink based on a slug field:</p>
-<pre><code> account = HyperlinkedRelatedField(read_only=True,
- lookup_field='slug',
- view_name='account-detail')
-</code></pre>
-<p>Usage of the old-style attributes continues to be supported, but will raise a <code>PendingDeprecationWarning</code>.</p>
-<h2 id="fileuploadparser">FileUploadParser</h2>
-<p>2.3 adds a <code>FileUploadParser</code> parser class, that supports raw file uploads, in addition to the existing multipart upload support.</p>
-<h2 id="decimalfield">DecimalField</h2>
-<p>2.3 introduces a <code>DecimalField</code> serializer field, which returns <code>Decimal</code> instances.</p>
-<p>For most cases APIs using model fields will behave as previously, however if you are using a custom renderer, not provided by REST framework, then you may now need to add support for rendering <code>Decimal</code> instances to your renderer implementation.</p>
-<h2 id="modelserializers-and-reverse-relationships">ModelSerializers and reverse relationships</h2>
-<p>The support for adding reverse relationships to the <code>fields</code> option on a <code>ModelSerializer</code> class means that the <code>get_related_field</code> and <code>get_nested_field</code> method signatures have now changed.</p>
-<p>In the unlikely event that you're providing a custom serializer class, and implementing these methods you should note the new call signature for both methods is now <code>(self, model_field, related_model, to_many)</code>. For reverse relationships <code>model_field</code> will be <code>None</code>.</p>
-<p>The old-style signature will continue to function but will raise a <code>PendingDeprecationWarning</code>.</p>
-<h2 id="view-names-and-descriptions">View names and descriptions</h2>
-<p>The mechanics of how the names and descriptions used in the browsable API are generated has been modified and cleaned up somewhat.</p>
-<p>If you've been customizing this behavior, for example perhaps to use <code>rst</code> markup for the browsable API, then you'll need to take a look at the implementation to see what updates you need to make.</p>
-<p>Note that the relevant methods have always been private APIs, and the docstrings called them out as intended to be deprecated.</p>
-<hr />
-<h1 id="other-notes">Other notes</h1>
-<h2 id="more-explicit-style">More explicit style</h2>
-<p>The usage of <code>model</code> attribute in generic Views is still supported, but it's usage is generally being discouraged throughout the documentation, in favour of the setting the more explicit <code>queryset</code> and <code>serializer_class</code> attributes.</p>
-<p>For example, the following is now the recommended style for using generic views:</p>
-<pre><code>class AccountListView(generics.RetrieveAPIView):
- queryset = MyModel.objects.all()
- serializer_class = MyModelSerializer
-</code></pre>
-<p>Using an explicit <code>queryset</code> and <code>serializer_class</code> attributes makes the functioning of the view more clear than using the shortcut <code>model</code> attribute.</p>
-<p>It also makes the usage of the <code>get_queryset()</code> or <code>get_serializer_class()</code> methods more obvious.</p>
-<pre><code>class AccountListView(generics.RetrieveAPIView):
- serializer_class = MyModelSerializer
-
- def get_queryset(self):
- """
- Determine the queryset dynamically, depending on the
- user making the request.
-
- Note that overriding this method follows on more obviously now
- that an explicit `queryset` attribute is the usual view style.
- """
- return self.user.accounts
-</code></pre>
-<h2 id="django-13-support">Django 1.3 support</h2>
-<p>The 2.3.x release series will be the last series to provide compatibility with Django 1.3.</p>
-<h2 id="version-22-api-changes">Version 2.2 API changes</h2>
-<p>All API changes in 2.2 that previously raised <code>PendingDeprecationWarning</code> will now raise a <code>DeprecationWarning</code>, which is loud by default.</p>
-<h2 id="what-comes-next">What comes next?</h2>
-<ul>
-<li>Support for read-write nested serializers is almost complete, and due to be released in the next few weeks.</li>
-<li>Extra filter backends for searching and ordering of results are planned to be added shortly.</li>
-</ul>
-<p>The next few months should see a renewed focus on addressing outstanding tickets. The 2.4 release is currently planned for around August-September.</p>
-
- </div>
- <!--/span-->
- </div>
- <!--/row-->
- </div>
- <!--/.fluid-container-->
- </div>
- <!--/.body content-->
- <div id="push"></div>
- </div>
- <!--/.wrapper -->
-
- <footer class="span12">
- <p>Documentation built with <a href="http://www.mkdocs.org/">MkDocs</a>.</a>
- </p>
- </footer>
-
- <!-- Le javascript
- ================================================== -->
- <!-- Placed at the end of the document so the pages load faster -->
- <script src="../../js/jquery-1.8.1-min.js"></script>
- <script src="../../js/prettify-1.0.js"></script>
- <script src="../../js/bootstrap-2.1.1-min.js"></script>
- <script src="../../js/theme.js"></script>
-
- <script>
- //$('.side-nav').scrollspy()
- var shiftWindow = function() {
- scrollBy(0, -50)
- };
- if (location.hash) shiftWindow();
- window.addEventListener("hashchange", shiftWindow);
-
- $('.dropdown-menu').on('click touchstart', function(event) {
- event.stopPropagation();
- });
-
- // Dynamically force sidenav to no higher than browser window
- $('.side-nav').css('max-height', window.innerHeight - 130);
-
- $(function() {
- $(window).resize(function() {
- $('.side-nav').css('max-height', window.innerHeight - 130);
- });
- });
- </script>
-</body>
-
-</html> \ No newline at end of file
diff --git a/topics/3.0-announcement/index.html b/topics/3.0-announcement/index.html
index ccd152e8..056d6f31 100644
--- a/topics/3.0-announcement/index.html
+++ b/topics/3.0-announcement/index.html
@@ -62,10 +62,10 @@
<div class="navbar-inner">
<div class="container-fluid">
<a class="repo-link btn btn-primary btn-small" href="https://github.com/tomchristie/django-rest-framework/tree/master">GitHub</a>
- <a class="repo-link btn btn-inverse btn-small " rel="prev" href="../kickstarter-announcement">
+ <a class="repo-link btn btn-inverse btn-small " rel="prev" href="../3.1-announcement">
Next <i class="icon-arrow-right icon-white"></i>
</a>
- <a class="repo-link btn btn-inverse btn-small " rel="next" href="../2.4-announcement">
+ <a class="repo-link btn btn-inverse btn-small " rel="next" href="../project-management">
<i class="icon-arrow-left icon-white"></i> Previous
</a>
<a class="repo-link btn btn-inverse btn-small" href="#searchModal" data-toggle="modal"><i class="icon-search icon-white"></i> Search</a>
@@ -189,6 +189,10 @@
</li>
<li >
+ <a href="../../api-guide/versioning">Versioning</a>
+ </li>
+
+ <li >
<a href="../../api-guide/content-negotiation">Content negotiation</a>
</li>
@@ -232,6 +236,10 @@
</li>
<li >
+ <a href="../internationalization">Internationalization</a>
+ </li>
+
+ <li >
<a href="../ajax-csrf-cors">AJAX, CSRF & CORS</a>
</li>
@@ -259,36 +267,20 @@
<a href="../project-management">Project management</a>
</li>
- <li >
- <a href="../rest-framework-2-announcement">2.0 Announcement</a>
- </li>
-
- <li >
- <a href="../2.2-announcement">2.2 Announcement</a>
- </li>
-
- <li >
- <a href="../2.3-announcement">2.3 Announcement</a>
- </li>
-
- <li >
- <a href="../2.4-announcement">2.4 Announcement</a>
- </li>
-
<li class="active" >
<a href=".">3.0 Announcement</a>
</li>
<li >
- <a href="../kickstarter-announcement">Kickstarter Announcement</a>
+ <a href="../3.1-announcement">3.1 Announcement</a>
</li>
<li >
- <a href="../release-notes">Release Notes</a>
+ <a href="../kickstarter-announcement">Kickstarter Announcement</a>
</li>
<li >
- <a href="../credits">Credits</a>
+ <a href="../release-notes">Release Notes</a>
</li>
</ul>
diff --git a/topics/2.4-announcement/index.html b/topics/3.1-announcement/index.html
index 2ea710fe..f134c3eb 100644
--- a/topics/2.4-announcement/index.html
+++ b/topics/3.1-announcement/index.html
@@ -4,11 +4,11 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
- <title>2.4 Announcement - Django REST framework</title>
+ <title>3.1 Announcement - Django REST framework</title>
<link href="../../img/favicon.ico" rel="icon" type="image/x-icon">
- <link rel="canonical" href="http://www.django-rest-framework.org/topics/2.4-announcement/" />
+ <link rel="canonical" href="http://www.django-rest-framework.org/topics/3.1-announcement/" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta name="description" content="Django, API, REST, 2.4 Announcement">
+ <meta name="description" content="Django, API, REST, 3.1 Announcement">
<meta name="author" content="Tom Christie">
<!-- Le styles -->
@@ -62,10 +62,10 @@
<div class="navbar-inner">
<div class="container-fluid">
<a class="repo-link btn btn-primary btn-small" href="https://github.com/tomchristie/django-rest-framework/tree/master">GitHub</a>
- <a class="repo-link btn btn-inverse btn-small " rel="prev" href="../3.0-announcement">
+ <a class="repo-link btn btn-inverse btn-small " rel="prev" href="../kickstarter-announcement">
Next <i class="icon-arrow-right icon-white"></i>
</a>
- <a class="repo-link btn btn-inverse btn-small " rel="next" href="../2.3-announcement">
+ <a class="repo-link btn btn-inverse btn-small " rel="next" href="../3.0-announcement">
<i class="icon-arrow-left icon-white"></i> Previous
</a>
<a class="repo-link btn btn-inverse btn-small" href="#searchModal" data-toggle="modal"><i class="icon-search icon-white"></i> Search</a>
@@ -189,6 +189,10 @@
</li>
<li >
+ <a href="../../api-guide/versioning">Versioning</a>
+ </li>
+
+ <li >
<a href="../../api-guide/content-negotiation">Content negotiation</a>
</li>
@@ -232,6 +236,10 @@
</li>
<li >
+ <a href="../internationalization">Internationalization</a>
+ </li>
+
+ <li >
<a href="../ajax-csrf-cors">AJAX, CSRF & CORS</a>
</li>
@@ -260,23 +268,11 @@
</li>
<li >
- <a href="../rest-framework-2-announcement">2.0 Announcement</a>
- </li>
-
- <li >
- <a href="../2.2-announcement">2.2 Announcement</a>
- </li>
-
- <li >
- <a href="../2.3-announcement">2.3 Announcement</a>
+ <a href="../3.0-announcement">3.0 Announcement</a>
</li>
<li class="active" >
- <a href=".">2.4 Announcement</a>
- </li>
-
- <li >
- <a href="../3.0-announcement">3.0 Announcement</a>
+ <a href=".">3.1 Announcement</a>
</li>
<li >
@@ -287,10 +283,6 @@
<a href="../release-notes">Release Notes</a>
</li>
- <li >
- <a href="../credits">Credits</a>
- </li>
-
</ul>
</li>
@@ -353,36 +345,32 @@
<li class="main">
- <a href="#django-rest-framework-24">Django REST framework 2.4</a>
+ <a href="#django-rest-framework-31">Django REST framework 3.1</a>
</li>
<li>
- <a href="#version-requirements">Version requirements</a>
- </li>
-
- <li>
- <a href="#django-17-support">Django 1.7 support</a>
+ <a href="#pagination">Pagination</a>
</li>
<li>
- <a href="#deprecation-of-model-view-attribute">Deprecation of .model view attribute</a>
+ <a href="#versioning">Versioning</a>
</li>
<li>
- <a href="#updated-test-runner">Updated test runner</a>
+ <a href="#internationalization">Internationalization</a>
</li>
<li>
- <a href="#improved-viewset-routing">Improved viewset routing</a>
+ <a href="#new-field-types">New field types</a>
</li>
<li>
- <a href="#throttle-behavior">Throttle behavior</a>
+ <a href="#modelserializer-api">ModelSerializer API</a>
</li>
<li>
- <a href="#other-features">Other features</a>
+ <a href="#moving-packages-out-of-core">Moving packages out of core</a>
</li>
<li>
@@ -390,11 +378,7 @@
</li>
<li>
- <a href="#labels-and-milestones">Labels and milestones</a>
- </li>
-
- <li>
- <a href="#next-steps">Next steps</a>
+ <a href="#whats-next">What's next?</a>
</li>
@@ -410,113 +394,148 @@
<div id="main-content" class="span9">
- <h1 id="django-rest-framework-24">Django REST framework 2.4</h1>
-<p>The 2.4 release is largely an intermediate step, tying up some outstanding issues prior to the 3.x series.</p>
-<h2 id="version-requirements">Version requirements</h2>
-<p>Support for Django 1.3 has been dropped.
-The lowest supported version of Django is now 1.4.2.</p>
-<p>The current plan is for REST framework to remain in lockstep with <a href="https://docs.djangoproject.com/en/dev/internals/release-process/#long-term-support-lts-releases">Django's long-term support policy</a>.</p>
-<h2 id="django-17-support">Django 1.7 support</h2>
-<p>The optional authtoken application now includes support for <em>both</em> Django 1.7 schema migrations, <em>and</em> for old-style <code>south</code> migrations.</p>
-<p><strong>If you are using authtoken, and you want to continue using <code>south</code>, you must upgrade your <code>south</code> package to version 1.0.</strong></p>
-<h2 id="deprecation-of-model-view-attribute">Deprecation of <code>.model</code> view attribute</h2>
-<p>The <code>.model</code> attribute on view classes is an optional shortcut for either or both of <code>.serializer_class</code> and <code>.queryset</code>. Its usage results in more implicit, less obvious behavior.</p>
-<p>The documentation has previously stated that usage of the more explicit style is prefered, and we're now taking that one step further and deprecating the usage of the <code>.model</code> shortcut.</p>
-<p>Doing so will mean that there are cases of API code where you'll now need to include a serializer class where you previously were just using the <code>.model</code> shortcut. However we firmly believe that it is the right trade-off to make.</p>
-<p>Removing the shortcut takes away an unnecessary layer of abstraction, and makes your codebase more explicit without any significant extra complexity. It also results in better consistency, as there's now only one way to set the serializer class and queryset attributes for the view, instead of two.</p>
-<p>The <code>DEFAULT_MODEL_SERIALIZER_CLASS</code> API setting is now also deprecated.</p>
-<h2 id="updated-test-runner">Updated test runner</h2>
-<p>We now have a new test runner for developing against the project,, that uses the excellent <a href="http://pytest.org">py.test</a> library.</p>
-<p>To use it make sure you have first installed the test requirements.</p>
-<pre><code>pip install -r requirements-test.txt
-</code></pre>
-<p>Then run the <code>runtests.py</code> script.</p>
-<pre><code>./runtests.py
-</code></pre>
-<p>The new test runner also includes <a href="https://flake8.readthedocs.org">flake8</a> code linting, which should help keep our coding style consistent.</p>
-<h4 id="test-runner-flags">Test runner flags</h4>
-<p>Run using a more concise output style.</p>
-<pre><code>./runtests -q
+ <h1 id="django-rest-framework-31">Django REST framework 3.1</h1>
+<p>The 3.1 release is an intermediate step in the Kickstarter project releases, and includes a range of new functionality.</p>
+<p>Some highlights include:</p>
+<ul>
+<li>A super-smart cursor pagination scheme.</li>
+<li>An improved pagination API, supporting header or in-body pagination styles.</li>
+<li>Pagination controls rendering in the browsable API.</li>
+<li>Better support for API versioning.</li>
+<li>Built-in internationalization support.</li>
+<li>Support for Django 1.8's <code>HStoreField</code> and <code>ArrayField</code>.</li>
+</ul>
+<hr />
+<h2 id="pagination">Pagination</h2>
+<p>The pagination API has been improved, making it both easier to use, and more powerful.</p>
+<p>A guide to the headline features follows. For full details, see <a href="../../api-guide/pagination">the pagination documentation</a>.</p>
+<p>Note that as a result of this work a number of settings keys and generic view attributes are now moved to pending deprecation. Controlling pagination styles is now largely handled by overriding a pagination class and modifying its configuration attributes.</p>
+<ul>
+<li>The <code>PAGINATE_BY</code> settings key will continue to work but is now pending deprecation. The more obviously named <code>PAGE_SIZE</code> settings key should now be used instead.</li>
+<li>The <code>PAGINATE_BY_PARAM</code>, <code>MAX_PAGINATE_BY</code> settings keys will continue to work but are now pending deprecation, in favor of setting configuration attributes on the configured pagination class.</li>
+<li>The <code>paginate_by</code>, <code>page_query_param</code>, <code>paginate_by_param</code> and <code>max_paginate_by</code> generic view attributes will continue to work but are now pending deprecation, in favor of setting configuration attributes on the configured pagination class.</li>
+<li>The <code>pagination_serializer_class</code> view attribute and <code>DEFAULT_PAGINATION_SERIALIZER_CLASS</code> settings key <strong>are no longer valid</strong>. The pagination API does not use serializers to determine the output format, and you'll need to instead override the <code>get_paginated_response</code> method on a pagination class in order to specify how the output format is controlled.</li>
+</ul>
+<h4 id="new-pagination-schemes">New pagination schemes.</h4>
+<p>Until now, there has only been a single built-in pagination style in REST framework. We now have page, limit/offset and cursor based schemes included by default.</p>
+<p>The cursor based pagination scheme is particularly smart, and is a better approach for clients iterating through large or frequently changing result sets. The scheme supports paging against non-unique indexes, by using both cursor and limit/offset information. It also allows for both forward and reverse cursor pagination. Much credit goes to David Cramer for <a href="http://cramer.io/2011/03/08/building-cursors-for-the-disqus-api/">this blog post</a> on the subject.</p>
+<h4 id="pagination-controls-in-the-browsable-api">Pagination controls in the browsable API.</h4>
+<p>Paginated results now include controls that render directly in the browsable API. If you're using the page or limit/offset style, then you'll see a page based control displayed in the browsable API:</p>
+<p><img alt="page number based pagination" src="../../../img/pages-pagination.png" /></p>
+<p>The cursor based pagination renders a more simple style of control:</p>
+<p><img alt="cursor based pagination" src="../../../img/cursor-pagination.png" /></p>
+<h4 id="support-for-header-based-pagination">Support for header-based pagination.</h4>
+<p>The pagination API was previously only able to alter the pagination style in the body of the response. The API now supports being able to write pagination information in response headers, making it possible to use pagination schemes that use the <code>Link</code> or <code>Content-Range</code> headers.</p>
+<p>For more information, see the <a href="../../../api-guide/pagination/#custom-pagination-styles">custom pagination styles</a> documentation.</p>
+<hr />
+<h2 id="versioning">Versioning</h2>
+<p>We've made it easier to build versioned APIs. Built-in schemes for versioning include both URL based and Accept header based variations.</p>
+<p>When using a URL based scheme, hyperlinked serializers will resolve relationships to the same API version as used on the incoming request.</p>
+<p>For example, when using <code>NamespaceVersioning</code>, and the following hyperlinked serializer:</p>
+<pre><code>class AccountsSerializer(serializer.HyperlinkedModelSerializer):
+ class Meta:
+ model = Accounts
+ fields = ('account_name', 'users')
</code></pre>
-<p>Run the tests using a more concise output style, no coverage, no flake8.</p>
-<pre><code>./runtests --fast
+<p>The output representation would match the version used on the incoming request. Like so:</p>
+<pre><code>GET http://example.org/v2/accounts/10 # Version 'v2'
+
+{
+ "account_name": "europa",
+ "users": [
+ "http://example.org/v2/users/12", # Version 'v2'
+ "http://example.org/v2/users/54",
+ "http://example.org/v2/users/87"
+ ]
+}
</code></pre>
-<p>Don't run the flake8 code linting.</p>
-<pre><code>./runtests --nolint
+<hr />
+<h2 id="internationalization">Internationalization</h2>
+<p>REST framework now includes a built-in set of translations, and supports internationalized error responses. This allows you to either change the default language, or to allow clients to specify the language via the <code>Accept-Language</code> header.</p>
+<p>You can change the default language by using the standard Django <code>LANGUAGE_CODE</code> setting:</p>
+<pre><code>LANGUAGE_CODE = "es-es"
</code></pre>
-<p>Only run the flake8 code linting, don't run the tests.</p>
-<pre><code>./runtests --lintonly
+<p>You can turn on per-request language requests by adding <code>LocalMiddleware</code> to your <code>MIDDLEWARE_CLASSES</code> setting:</p>
+<pre><code>MIDDLEWARE_CLASSES = [
+ ...
+ 'django.middleware.locale.LocaleMiddleware'
+]
</code></pre>
-<p>Run the tests for a given test case.</p>
-<pre><code>./runtests MyTestCase
+<p>When per-request internationalization is enabled, client requests will respect the <code>Accept-Language</code> header where possible. For example, let's make a request for an unsupported media type:</p>
+<p><strong>Request</strong></p>
+<pre><code>GET /api/users HTTP/1.1
+Accept: application/xml
+Accept-Language: es-es
+Host: example.org
</code></pre>
-<p>Run the tests for a given test method.</p>
-<pre><code>./runtests MyTestCase.test_this_method
+<p><strong>Response</strong></p>
+<pre><code>HTTP/1.0 406 NOT ACCEPTABLE
+
+{
+ "detail": "No se ha podido satisfacer la solicitud de cabecera de Accept."
+}
</code></pre>
-<p>Shorter form to run the tests for a given test method.</p>
-<pre><code>./runtests test_this_method
+<p>Note that the structure of the error responses is still the same. We still have a <code>details</code> key in the response. If needed you can modify this behavior too, by using a <a href="../../api-guide/exceptions#custom-exception-handling">custom exception handler</a>.</p>
+<p>We include built-in translations both for standard exception cases, and for serializer validation errors.</p>
+<p>The full list of supported languages can be found on our <a href="https://www.transifex.com/projects/p/django-rest-framework/">Transifex project page</a>.</p>
+<p>If you only wish to support a subset of the supported languages, use Django's standard <code>LANGUAGES</code> setting:</p>
+<pre><code>LANGUAGES = [
+ ('de', _('German')),
+ ('en', _('English')),
+]
</code></pre>
-<p>Note: The test case and test method matching is fuzzy and will sometimes run other tests that contain a partial string match to the given command line input.</p>
-<h2 id="improved-viewset-routing">Improved viewset routing</h2>
-<p>The <code>@action</code> and <code>@link</code> decorators were inflexible in that they only allowed additional routes to be added against instance style URLs, not against list style URLs.</p>
-<p>The <code>@action</code> and <code>@link</code> decorators have now been moved to pending deprecation, and the <code>@list_route</code> and <code>@detail_route</code> decorators have been introduced.</p>
-<p>Here's an example of using the new decorators. Firstly we have a detail-type route named "set_password" that acts on a single instance, and takes a <code>pk</code> argument in the URL. Secondly we have a list-type route named "recent_users" that acts on a queryset, and does not take any arguments in the URL.</p>
-<pre><code>class UserViewSet(viewsets.ModelViewSet):
- """
- A viewset that provides the standard actions
- """
- queryset = User.objects.all()
- serializer_class = UserSerializer
-
- @detail_route(methods=['post'])
- def set_password(self, request, pk=None):
- user = self.get_object()
- serializer = PasswordSerializer(data=request.DATA)
- if serializer.is_valid():
- user.set_password(serializer.data['password'])
- user.save()
- return Response({'status': 'password set'})
- else:
- return Response(serializer.errors,
- status=status.HTTP_400_BAD_REQUEST)
-
- @list_route()
- def recent_users(self, request):
- recent_users = User.objects.all().order('-last_login')
- page = self.paginate_queryset(recent_users)
- serializer = self.get_pagination_serializer(page)
- return Response(serializer.data)
+<p>For more details, see the <a href="../internationalization">internationalization documentation</a>.</p>
+<p>Many thanks to <a href="https://github.com/jakul">Craig Blaszczyk</a> for helping push this through.</p>
+<hr />
+<h2 id="new-field-types">New field types</h2>
+<p>Django 1.8's new <code>ArrayField</code>, <code>HStoreField</code> and <code>UUIDField</code> are now all fully supported.</p>
+<p>This work also means that we now have both <code>serializers.DictField()</code>, and <code>serializers.ListField()</code> types, allowing you to express and validate a wider set of representations.</p>
+<p>If you're building a new 1.8 project, then you should probably consider using <code>UUIDField</code> as the primary keys for all your models. This style will work automatically with hyperlinked serializers, returning URLs in the following style:</p>
+<pre><code>http://example.org/api/purchases/9b1a433f-e90d-4948-848b-300fdc26365d
</code></pre>
-<p>For more details, see the <a href="../../api-guide/viewsets">viewsets documentation</a>.</p>
-<h2 id="throttle-behavior">Throttle behavior</h2>
-<p>There's one bugfix in 2.4 that's worth calling out, as it will <em>invalidate existing throttle caches</em> when you upgrade.</p>
-<p>We've now fixed a typo on the <code>cache_format</code> attribute. Previously this was named <code>"throtte_%(scope)s_%(ident)s"</code>, it is now <code>"throttle_%(scope)s_%(ident)s"</code>.</p>
-<p>If you're concerned about the invalidation you have two options.</p>
+<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/#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>
+<p>We're making this change in order to help distribute the maintainance workload, and keep better focus of the core essentials of the framework.</p>
+<p>The change also means we can be more flexible with which external packages we recommend. For example, the excellently maintained <a href="https://github.com/evonove/django-oauth-toolkit">Django OAuth toolkit</a> has now been promoted as our recommended option for integrating OAuth support.</p>
+<p>The following packages are now moved out of core and should be separately installed:</p>
<ul>
-<li>Manually pre-populate your cache with the fixed version.</li>
-<li>Set the <code>cache_format</code> attribute on your throttle class in order to retain the previous incorrect spelling.</li>
+<li>OAuth - <a href="http://jpadilla.github.io/django-rest-framework-oauth/">djangorestframework-oauth</a></li>
+<li>XML - <a href="http://jpadilla.github.io/django-rest-framework-xml">djangorestframework-xml</a></li>
+<li>YAML - <a href="http://jpadilla.github.io/django-rest-framework-yaml">djangorestframework-yaml</a></li>
+<li>JSONP - <a href="http://jpadilla.github.io/django-rest-framework-jsonp">djangorestframework-jsonp</a></li>
</ul>
-<h2 id="other-features">Other features</h2>
-<p>There are also a number of other features and bugfixes as <a href="../../release-notes#240">listed in the release notes</a>. In particular these include:</p>
-<p><a href="../../../api-guide/settings#view-names-and-descriptions">Customizable view name and description functions</a> for use with the browsable API, by using the <code>VIEW_NAME_FUNCTION</code> and <code>VIEW_DESCRIPTION_FUNCTION</code> settings.</p>
-<p>Smarter <a href="../../../api-guide/throttling#how-clients-are-identified">client IP identification for throttling</a>, with the addition of the <code>NUM_PROXIES</code> setting.</p>
-<p>Added the standardized <code>Retry-After</code> header to throttled responses, as per <a href="http://tools.ietf.org/html/rfc6585">RFC 6585</a>. This should now be used in preference to the custom <code>X-Throttle-Wait-Seconds</code> header which will be fully deprecated in 3.0.</p>
-<h2 id="deprecations">Deprecations</h2>
-<p>All API changes in 2.3 that previously raised <code>PendingDeprecationWarning</code> will now raise a <code>DeprecationWarning</code>, which is loud by default.</p>
-<p>All API changes in 2.3 that previously raised <code>DeprecationWarning</code> have now been removed entirely.</p>
-<p>Furter details on these deprecations is available in the <a href="../../2.3-announcement">2.3 announcement</a>.</p>
-<h2 id="labels-and-milestones">Labels and milestones</h2>
-<p>Although not strictly part of the 2.4 release it's also worth noting here that we've been working hard towards improving our triage process.</p>
-<p>The <a href="https://github.com/tomchristie/django-rest-framework/issues">labels that we use in GitHub</a> have been cleaned up, and all existing tickets triaged. Any given ticket should have one and only one label, indicating its current state.</p>
-<p>We've also <a href="https://github.com/tomchristie/django-rest-framework/milestones">started using milestones</a> in order to track tickets against particular releases.</p>
+<p>It's worth reiterating that this change in policy shouldn't mean any work in your codebase other than adding a new requirement and modifying some import paths. For example to install XML rendering, you would now do:</p>
+<pre><code>pip install djangorestframework-xml
+</code></pre>
+<p>And modify your settings, like so:</p>
+<pre><code>REST_FRAMEWORK = {
+ 'DEFAULT_RENDERER_CLASSES': [
+ 'rest_framework.renderers.JSONRenderer',
+ 'rest_framework.renderers.BrowsableAPIRenderer',
+ 'rest_framework_xml.renderers.XMLRenderer'
+ ]
+}
+</code></pre>
+<p>Thanks go to the latest member of our maintenance team, <a href="https://github.com/jpadilla/">José Padilla</a>, for handling this work and taking on ownership of these packages.</p>
<hr />
-<p><img alt="Labels and milestones" src="../../../img/labels-and-milestones.png" /></p>
-<p><strong>Above</strong>: <em>Overview of our current use of labels and milestones in GitHub.</em></p>
+<h2 id="deprecations">Deprecations</h2>
+<p>The <code>request.DATA</code>, <code>request.FILES</code> and <code>request.QUERY_PARAMS</code> attributes move from pending deprecation, to deprecated. Use <code>request.data</code> and <code>request.query_params</code> instead, as discussed in the 3.0 release notes.</p>
+<p>The ModelSerializer Meta options for <code>write_only_fields</code>, <code>view_name</code> and <code>lookup_field</code> are also moved from pending deprecation, to deprecated. Use <code>extra_kwargs</code> instead, as discussed in the 3.0 release notes.</p>
+<p>All these attributes and options will still work in 3.1, but their usage will raise a warning. They will be fully removed in 3.2.</p>
<hr />
-<p>We hope both of these changes will help make the management process more clear and obvious and help keep tickets well-organised and relevant.</p>
-<h2 id="next-steps">Next steps</h2>
-<p>The next planned release will be 3.0, featuring an improved and simplified serializer implementation.</p>
-<p>Once again, many thanks to all the generous <a href="../../kickstarter-announcement#sponsors">backers and sponsors</a> who've helped make this possible!</p>
+<h2 id="whats-next">What's next?</h2>
+<p>The next focus will be on HTML renderings of API output and will include:</p>
+<ul>
+<li>HTML form rendering of serializers.</li>
+<li>Filtering controls built-in to the browsable API.</li>
+<li>An alternative admin-style interface.</li>
+</ul>
+<p>This will either be made as a single 3.2 release, or split across two separate releases, with the HTML forms and filter controls coming in 3.2, and the admin-style interface coming in a 3.3 release.</p>
</div>
<!--/span-->
diff --git a/topics/ajax-csrf-cors/index.html b/topics/ajax-csrf-cors/index.html
index 64fa3d8d..707774a9 100644
--- a/topics/ajax-csrf-cors/index.html
+++ b/topics/ajax-csrf-cors/index.html
@@ -65,7 +65,7 @@
<a class="repo-link btn btn-inverse btn-small " rel="prev" href="../browser-enhancements">
Next <i class="icon-arrow-right icon-white"></i>
</a>
- <a class="repo-link btn btn-inverse btn-small " rel="next" href="../documenting-your-api">
+ <a class="repo-link btn btn-inverse btn-small " rel="next" href="../internationalization">
<i class="icon-arrow-left icon-white"></i> Previous
</a>
<a class="repo-link btn btn-inverse btn-small" href="#searchModal" data-toggle="modal"><i class="icon-search icon-white"></i> Search</a>
@@ -189,6 +189,10 @@
</li>
<li >
+ <a href="../../api-guide/versioning">Versioning</a>
+ </li>
+
+ <li >
<a href="../../api-guide/content-negotiation">Content negotiation</a>
</li>
@@ -231,6 +235,10 @@
<a href="../documenting-your-api">Documenting your API</a>
</li>
+ <li >
+ <a href="../internationalization">Internationalization</a>
+ </li>
+
<li class="active" >
<a href=".">AJAX, CSRF & CORS</a>
</li>
@@ -260,23 +268,11 @@
</li>
<li >
- <a href="../rest-framework-2-announcement">2.0 Announcement</a>
- </li>
-
- <li >
- <a href="../2.2-announcement">2.2 Announcement</a>
- </li>
-
- <li >
- <a href="../2.3-announcement">2.3 Announcement</a>
- </li>
-
- <li >
- <a href="../2.4-announcement">2.4 Announcement</a>
+ <a href="../3.0-announcement">3.0 Announcement</a>
</li>
<li >
- <a href="../3.0-announcement">3.0 Announcement</a>
+ <a href="../3.1-announcement">3.1 Announcement</a>
</li>
<li >
@@ -287,10 +283,6 @@
<a href="../release-notes">Release Notes</a>
</li>
- <li >
- <a href="../credits">Credits</a>
- </li>
-
</ul>
</li>
diff --git a/topics/browsable-api/index.html b/topics/browsable-api/index.html
index bd4a1992..251a897d 100644
--- a/topics/browsable-api/index.html
+++ b/topics/browsable-api/index.html
@@ -189,6 +189,10 @@
</li>
<li >
+ <a href="../../api-guide/versioning">Versioning</a>
+ </li>
+
+ <li >
<a href="../../api-guide/content-negotiation">Content negotiation</a>
</li>
@@ -232,6 +236,10 @@
</li>
<li >
+ <a href="../internationalization">Internationalization</a>
+ </li>
+
+ <li >
<a href="../ajax-csrf-cors">AJAX, CSRF & CORS</a>
</li>
@@ -260,23 +268,11 @@
</li>
<li >
- <a href="../rest-framework-2-announcement">2.0 Announcement</a>
- </li>
-
- <li >
- <a href="../2.2-announcement">2.2 Announcement</a>
- </li>
-
- <li >
- <a href="../2.3-announcement">2.3 Announcement</a>
- </li>
-
- <li >
- <a href="../2.4-announcement">2.4 Announcement</a>
+ <a href="../3.0-announcement">3.0 Announcement</a>
</li>
<li >
- <a href="../3.0-announcement">3.0 Announcement</a>
+ <a href="../3.1-announcement">3.1 Announcement</a>
</li>
<li >
@@ -287,10 +283,6 @@
<a href="../release-notes">Release Notes</a>
</li>
- <li >
- <a href="../credits">Credits</a>
- </li>
-
</ul>
</li>
diff --git a/topics/browser-enhancements/index.html b/topics/browser-enhancements/index.html
index 1a949705..29970516 100644
--- a/topics/browser-enhancements/index.html
+++ b/topics/browser-enhancements/index.html
@@ -189,6 +189,10 @@
</li>
<li >
+ <a href="../../api-guide/versioning">Versioning</a>
+ </li>
+
+ <li >
<a href="../../api-guide/content-negotiation">Content negotiation</a>
</li>
@@ -232,6 +236,10 @@
</li>
<li >
+ <a href="../internationalization">Internationalization</a>
+ </li>
+
+ <li >
<a href="../ajax-csrf-cors">AJAX, CSRF & CORS</a>
</li>
@@ -260,23 +268,11 @@
</li>
<li >
- <a href="../rest-framework-2-announcement">2.0 Announcement</a>
- </li>
-
- <li >
- <a href="../2.2-announcement">2.2 Announcement</a>
- </li>
-
- <li >
- <a href="../2.3-announcement">2.3 Announcement</a>
- </li>
-
- <li >
- <a href="../2.4-announcement">2.4 Announcement</a>
+ <a href="../3.0-announcement">3.0 Announcement</a>
</li>
<li >
- <a href="../3.0-announcement">3.0 Announcement</a>
+ <a href="../3.1-announcement">3.1 Announcement</a>
</li>
<li >
@@ -287,10 +283,6 @@
<a href="../release-notes">Release Notes</a>
</li>
- <li >
- <a href="../credits">Credits</a>
- </li>
-
</ul>
</li>
diff --git a/topics/contributing/index.html b/topics/contributing/index.html
index 0a28159d..ed151d63 100644
--- a/topics/contributing/index.html
+++ b/topics/contributing/index.html
@@ -189,6 +189,10 @@
</li>
<li >
+ <a href="../../api-guide/versioning">Versioning</a>
+ </li>
+
+ <li >
<a href="../../api-guide/content-negotiation">Content negotiation</a>
</li>
@@ -232,6 +236,10 @@
</li>
<li >
+ <a href="../internationalization">Internationalization</a>
+ </li>
+
+ <li >
<a href="../ajax-csrf-cors">AJAX, CSRF & CORS</a>
</li>
@@ -260,23 +268,11 @@
</li>
<li >
- <a href="../rest-framework-2-announcement">2.0 Announcement</a>
- </li>
-
- <li >
- <a href="../2.2-announcement">2.2 Announcement</a>
- </li>
-
- <li >
- <a href="../2.3-announcement">2.3 Announcement</a>
- </li>
-
- <li >
- <a href="../2.4-announcement">2.4 Announcement</a>
+ <a href="../3.0-announcement">3.0 Announcement</a>
</li>
<li >
- <a href="../3.0-announcement">3.0 Announcement</a>
+ <a href="../3.1-announcement">3.1 Announcement</a>
</li>
<li >
@@ -287,10 +283,6 @@
<a href="../release-notes">Release Notes</a>
</li>
- <li >
- <a href="../credits">Credits</a>
- </li>
-
</ul>
</li>
diff --git a/topics/credits/index.html b/topics/credits/index.html
deleted file mode 100644
index 54575998..00000000
--- a/topics/credits/index.html
+++ /dev/null
@@ -1,626 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <meta charset="utf-8">
- <title>Credits - Django REST framework</title>
- <link href="../../img/favicon.ico" rel="icon" type="image/x-icon">
- <link rel="canonical" href="http://www.django-rest-framework.org/topics/credits/" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta name="description" content="Django, API, REST, Credits">
- <meta name="author" content="Tom Christie">
-
- <!-- Le styles -->
- <link href="../../css/prettify.css" rel="stylesheet">
- <link href="../../css/bootstrap.css" rel="stylesheet">
- <link href="../../css/bootstrap-responsive.css" rel="stylesheet">
- <link href="../../css/default.css" rel="stylesheet">
-
- <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
- <!--[if lt IE 9]>
- <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
- <![endif]-->
-
- <script type="text/javascript">
- var _gaq = _gaq || [];
- _gaq.push(['_setAccount', 'UA-18852272-2']);
- _gaq.push(['_trackPageview']);
-
- (function() {
- var ga = document.createElement('script');
- ga.type = 'text/javascript';
- ga.async = true;
- ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
- var s = document.getElementsByTagName('script')[0];
- s.parentNode.insertBefore(ga, s);
- })();
- </script>
-
- <style>
- span.fusion-wrap a {
- display: block;
- margin-top: 10px;
- color: black;
- }
- a.fusion-poweredby {
- display: block;
- margin-top: 10px;
- }
- @media (max-width: 767px) {
- div.promo {
- display: none;
- }
- }
- </style>
-</head>
-<body onload="prettyPrint()" class="-page">
-
- <div class="wrapper">
-
- <div class="navbar navbar-inverse navbar-fixed-top">
- <div class="navbar-inner">
- <div class="container-fluid">
- <a class="repo-link btn btn-primary btn-small" href="https://github.com/tomchristie/django-rest-framework/tree/master">GitHub</a>
- <a class="repo-link btn btn-inverse btn-small disabled" rel="prev" >
- Next <i class="icon-arrow-right icon-white"></i>
- </a>
- <a class="repo-link btn btn-inverse btn-small " rel="next" href="../release-notes">
- <i class="icon-arrow-left icon-white"></i> Previous
- </a>
- <a class="repo-link btn btn-inverse btn-small" href="#searchModal" data-toggle="modal"><i class="icon-search icon-white"></i> Search</a>
- <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- </a>
- <a class="brand" href="http://www.django-rest-framework.org">Django REST framework</a>
- <div class="nav-collapse collapse">
-
- <!-- Main navigation -->
- <ul class="nav navbar-nav">
- <li ><a href="/">Home</a></li>
-
- <li class="dropdown">
- <a href="#" class="dropdown-toggle" data-toggle="dropdown">Tutorial <b class="caret"></b></a>
- <ul class="dropdown-menu">
-
- <li >
- <a href="../../tutorial/quickstart">Quickstart</a>
- </li>
-
- <li >
- <a href="../../tutorial/1-serialization">1 - Serialization</a>
- </li>
-
- <li >
- <a href="../../tutorial/2-requests-and-responses">2 - Requests and responses</a>
- </li>
-
- <li >
- <a href="../../tutorial/3-class-based-views">3 - Class based views</a>
- </li>
-
- <li >
- <a href="../../tutorial/4-authentication-and-permissions">4 - Authentication and permissions</a>
- </li>
-
- <li >
- <a href="../../tutorial/5-relationships-and-hyperlinked-apis">5 - Relationships and hyperlinked APIs</a>
- </li>
-
- <li >
- <a href="../../tutorial/6-viewsets-and-routers">6 - Viewsets and routers</a>
- </li>
-
- </ul>
- </li>
-
- <li class="dropdown">
- <a href="#" class="dropdown-toggle" data-toggle="dropdown">API Guide <b class="caret"></b></a>
- <ul class="dropdown-menu">
-
- <li >
- <a href="../../api-guide/requests">Requests</a>
- </li>
-
- <li >
- <a href="../../api-guide/responses">Responses</a>
- </li>
-
- <li >
- <a href="../../api-guide/views">Views</a>
- </li>
-
- <li >
- <a href="../../api-guide/generic-views">Generic views</a>
- </li>
-
- <li >
- <a href="../../api-guide/viewsets">Viewsets</a>
- </li>
-
- <li >
- <a href="../../api-guide/routers">Routers</a>
- </li>
-
- <li >
- <a href="../../api-guide/parsers">Parsers</a>
- </li>
-
- <li >
- <a href="../../api-guide/renderers">Renderers</a>
- </li>
-
- <li >
- <a href="../../api-guide/serializers">Serializers</a>
- </li>
-
- <li >
- <a href="../../api-guide/fields">Serializer fields</a>
- </li>
-
- <li >
- <a href="../../api-guide/relations">Serializer relations</a>
- </li>
-
- <li >
- <a href="../../api-guide/validators">Validators</a>
- </li>
-
- <li >
- <a href="../../api-guide/authentication">Authentication</a>
- </li>
-
- <li >
- <a href="../../api-guide/permissions">Permissions</a>
- </li>
-
- <li >
- <a href="../../api-guide/throttling">Throttling</a>
- </li>
-
- <li >
- <a href="../../api-guide/filtering">Filtering</a>
- </li>
-
- <li >
- <a href="../../api-guide/pagination">Pagination</a>
- </li>
-
- <li >
- <a href="../../api-guide/content-negotiation">Content negotiation</a>
- </li>
-
- <li >
- <a href="../../api-guide/metadata">Metadata</a>
- </li>
-
- <li >
- <a href="../../api-guide/format-suffixes">Format suffixes</a>
- </li>
-
- <li >
- <a href="../../api-guide/reverse">Returning URLs</a>
- </li>
-
- <li >
- <a href="../../api-guide/exceptions">Exceptions</a>
- </li>
-
- <li >
- <a href="../../api-guide/status-codes">Status codes</a>
- </li>
-
- <li >
- <a href="../../api-guide/testing">Testing</a>
- </li>
-
- <li >
- <a href="../../api-guide/settings">Settings</a>
- </li>
-
- </ul>
- </li>
-
- <li class="dropdown active">
- <a href="#" class="dropdown-toggle" data-toggle="dropdown">Topics <b class="caret"></b></a>
- <ul class="dropdown-menu">
-
- <li >
- <a href="../documenting-your-api">Documenting your API</a>
- </li>
-
- <li >
- <a href="../ajax-csrf-cors">AJAX, CSRF & CORS</a>
- </li>
-
- <li >
- <a href="../browser-enhancements">Browser enhancements</a>
- </li>
-
- <li >
- <a href="../browsable-api">The Browsable API</a>
- </li>
-
- <li >
- <a href="../rest-hypermedia-hateoas">REST, Hypermedia & HATEOAS</a>
- </li>
-
- <li >
- <a href="../third-party-resources">Third Party Resources</a>
- </li>
-
- <li >
- <a href="../contributing">Contributing to REST framework</a>
- </li>
-
- <li >
- <a href="../project-management">Project management</a>
- </li>
-
- <li >
- <a href="../rest-framework-2-announcement">2.0 Announcement</a>
- </li>
-
- <li >
- <a href="../2.2-announcement">2.2 Announcement</a>
- </li>
-
- <li >
- <a href="../2.3-announcement">2.3 Announcement</a>
- </li>
-
- <li >
- <a href="../2.4-announcement">2.4 Announcement</a>
- </li>
-
- <li >
- <a href="../3.0-announcement">3.0 Announcement</a>
- </li>
-
- <li >
- <a href="../kickstarter-announcement">Kickstarter Announcement</a>
- </li>
-
- <li >
- <a href="../release-notes">Release Notes</a>
- </li>
-
- <li class="active" >
- <a href=".">Credits</a>
- </li>
-
- </ul>
- </li>
-
-
- </ul>
-
- </div>
- <!--/.nav-collapse -->
-
- </div>
- </div>
- </div>
-
- <div class="body-content">
- <div class="container-fluid">
-
- <!-- Search Modal -->
- <div id="searchModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
- <h3 id="myModalLabel">Documentation search</h3>
- </div>
-
- <div class="modal-body">
- <!-- Custom google search -->
- <script>
- (function() {
- var cx = '015016005043623903336:rxraeohqk6w';
- var gcse = document.createElement('script');
- gcse.type = 'text/javascript';
- gcse.async = true;
- gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
- '//www.google.com/cse/cse.js?cx=' + cx;
- var s = document.getElementsByTagName('script')[0];
- s.parentNode.insertBefore(gcse, s);
- })();
- </script>
- <gcse:search></gcse:search>
- </div>
-
- <div class="modal-footer">
- <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
- </div>
- </div>
-
- <div class="row-fluid">
-
- <div class="span3">
- <!-- TODO
- <p style="margin-top: -12px">
- <a class="btn btn-mini btn-primary" style="width: 60px">&laquo; previous</a>
- <a class="btn btn-mini btn-primary" style="float: right; margin-right: 8px; width: 60px;">next &raquo;</a>
- </p>
- -->
- <div id="table-of-contents">
- <ul class="nav nav-list side-nav well sidebar-nav-fixed">
-
-
-
-
-
- <li class="main">
- <a href="#credits">Credits</a>
- </li>
-
-
- <li>
- <a href="#additional-thanks">Additional thanks</a>
- </li>
-
- <li>
- <a href="#contact">Contact</a>
- </li>
-
-
-
-
-
-
- </ul>
-
- </div>
- </div>
-
- <div id="main-content" class="span9">
-
-
- <h1 id="credits">Credits</h1>
-<p>The following people have helped make REST framework great.</p>
-<ul>
-<li>Tom Christie - <a href="https://github.com/tomchristie">tomchristie</a></li>
-<li>Marko Tibold - <a href="https://github.com/markotibold">markotibold</a></li>
-<li>Paul Miller - <a href="https://github.com/paulmillr">paulmillr</a></li>
-<li>Sébastien Piquemal - <a href="https://github.com/sebpiq">sebpiq</a></li>
-<li>Carmen Wick - <a href="https://github.com/cwick">cwick</a></li>
-<li>Alex Ehlke - <a href="https://github.com/aehlke">aehlke</a></li>
-<li>Alen Mujezinovic - <a href="https://github.com/flashingpumpkin">flashingpumpkin</a></li>
-<li>Carles Barrobés - <a href="https://github.com/txels">txels</a></li>
-<li>Michael Fötsch - <a href="https://github.com/mfoetsch">mfoetsch</a></li>
-<li>David Larlet - <a href="https://github.com/david">david</a></li>
-<li>Andrew Straw - <a href="https://github.com/astraw">astraw</a></li>
-<li>Zeth - <a href="https://github.com/zeth">zeth</a></li>
-<li>Fernando Zunino - <a href="https://github.com/fzunino">fzunino</a></li>
-<li>Jens Alm - <a href="https://github.com/ulmus">ulmus</a></li>
-<li>Craig Blaszczyk - <a href="https://github.com/jakul">jakul</a></li>
-<li>Garcia Solero - <a href="https://github.com/garciasolero">garciasolero</a></li>
-<li>Tom Drummond - <a href="https://github.com/devioustree">devioustree</a></li>
-<li>Danilo Bargen - <a href="https://github.com/dbrgn">dbrgn</a></li>
-<li>Andrew McCloud - <a href="https://github.com/amccloud">amccloud</a></li>
-<li>Thomas Steinacher - <a href="https://github.com/thomasst">thomasst</a></li>
-<li>Meurig Freeman - <a href="https://github.com/meurig">meurig</a></li>
-<li>Anthony Nemitz - <a href="https://github.com/anemitz">anemitz</a></li>
-<li>Ewoud Kohl van Wijngaarden - <a href="https://github.com/ekohl">ekohl</a></li>
-<li>Michael Ding - <a href="https://github.com/yandy">yandy</a></li>
-<li>Mjumbe Poe - <a href="https://github.com/mjumbewu">mjumbewu</a></li>
-<li>Natim - <a href="https://github.com/natim">natim</a></li>
-<li>Sebastian Żurek - <a href="https://github.com/sebzur">sebzur</a></li>
-<li>Benoit C - <a href="https://github.com/dzen">dzen</a></li>
-<li>Chris Pickett - <a href="https://github.com/bunchesofdonald">bunchesofdonald</a></li>
-<li>Ben Timby - <a href="https://github.com/btimby">btimby</a></li>
-<li>Michele Lazzeri - <a href="https://github.com/michelelazzeri-nextage">michelelazzeri-nextage</a></li>
-<li>Camille Harang - <a href="https://github.com/mammique">mammique</a></li>
-<li>Paul Oswald - <a href="https://github.com/poswald">poswald</a></li>
-<li>Sean C. Farley - <a href="https://github.com/scfarley">scfarley</a></li>
-<li>Daniel Izquierdo - <a href="https://github.com/izquierdo">izquierdo</a></li>
-<li>Can Yavuz - <a href="https://github.com/tschan">tschan</a></li>
-<li>Shawn Lewis - <a href="https://github.com/shawnlewis">shawnlewis</a></li>
-<li>Alec Perkins - <a href="https://github.com/alecperkins">alecperkins</a></li>
-<li>Michael Barrett - <a href="https://github.com/phobologic">phobologic</a></li>
-<li>Mathieu Dhondt - <a href="https://github.com/laundromat">laundromat</a></li>
-<li>Johan Charpentier - <a href="https://github.com/cyberj">cyberj</a></li>
-<li>Jamie Matthews - <a href="https://github.com/j4mie">j4mie</a></li>
-<li>Mattbo - <a href="https://github.com/mattbo">mattbo</a></li>
-<li>Max Hurl - <a href="https://github.com/maximilianhurl">maximilianhurl</a></li>
-<li>Tomi Pajunen - <a href="https://github.com/eofs">eofs</a></li>
-<li>Rob Dobson - <a href="https://github.com/rdobson">rdobson</a></li>
-<li>Daniel Vaca Araujo - <a href="https://github.com/diviei">diviei</a></li>
-<li>Madis Väin - <a href="https://github.com/madisvain">madisvain</a></li>
-<li>Stephan Groß - <a href="https://github.com/minddust">minddust</a></li>
-<li>Pavel Savchenko - <a href="https://github.com/asfaltboy">asfaltboy</a></li>
-<li>Otto Yiu - <a href="https://github.com/OttoYiu">ottoyiu</a></li>
-<li>Jacob Magnusson - <a href="https://github.com/jmagnusson">jmagnusson</a></li>
-<li>Osiloke Harold Emoekpere - <a href="https://github.com/osiloke">osiloke</a></li>
-<li>Michael Shepanski - <a href="https://github.com/mjs7231">mjs7231</a></li>
-<li>Toni Michel - <a href="https://github.com/tonimichel">tonimichel</a></li>
-<li>Ben Konrath - <a href="https://github.com/benkonrath">benkonrath</a></li>
-<li>Marc Aymerich - <a href="https://github.com/glic3rinu">glic3rinu</a></li>
-<li>Ludwig Kraatz - <a href="https://github.com/ludwigkraatz">ludwigkraatz</a></li>
-<li>Rob Romano - <a href="https://github.com/robromano">robromano</a></li>
-<li>Eugene Mechanism - <a href="https://github.com/mechanism">mechanism</a></li>
-<li>Jonas Liljestrand - <a href="https://github.com/jonlil">jonlil</a></li>
-<li>Justin Davis - <a href="https://github.com/irrelative">irrelative</a></li>
-<li>Dustin Bachrach - <a href="https://github.com/dbachrach">dbachrach</a></li>
-<li>Mark Shirley - <a href="https://github.com/maspwr">maspwr</a></li>
-<li>Olivier Aubert - <a href="https://github.com/oaubert">oaubert</a></li>
-<li>Yuri Prezument - <a href="https://github.com/yprez">yprez</a></li>
-<li>Fabian Buechler - <a href="https://github.com/fabianbuechler">fabianbuechler</a></li>
-<li>Mark Hughes - <a href="https://github.com/mhsparks">mhsparks</a></li>
-<li>Michael van de Waeter - <a href="https://github.com/mvdwaeter">mvdwaeter</a></li>
-<li>Reinout van Rees - <a href="https://github.com/reinout">reinout</a></li>
-<li>Michael Richards - <a href="https://github.com/justanotherbody">justanotherbody</a></li>
-<li>Ben Roberts - <a href="https://github.com/roberts81">roberts81</a></li>
-<li>Venkata Subramanian Mahalingam - <a href="https://github.com/annacoder">annacoder</a></li>
-<li>George Kappel - <a href="https://github.com/gkappel">gkappel</a></li>
-<li>Colin Murtaugh - <a href="https://github.com/cmurtaugh">cmurtaugh</a></li>
-<li>Simon Pantzare - <a href="https://github.com/pilt">pilt</a></li>
-<li>Szymon Teżewski - <a href="https://github.com/sunscrapers">sunscrapers</a></li>
-<li>Joel Marcotte - <a href="https://github.com/joual">joual</a></li>
-<li>Trey Hunner - <a href="https://github.com/treyhunner">treyhunner</a></li>
-<li>Roman Akinfold - <a href="https://github.com/akinfold">akinfold</a></li>
-<li>Toran Billups - <a href="https://github.com/toranb">toranb</a></li>
-<li>Sébastien Béal - <a href="https://github.com/sebastibe">sebastibe</a></li>
-<li>Andrew Hankinson - <a href="https://github.com/ahankinson">ahankinson</a></li>
-<li>Juan Riaza - <a href="https://github.com/juanriaza">juanriaza</a></li>
-<li>Michael Mior - <a href="https://github.com/michaelmior">michaelmior</a></li>
-<li>Marc Tamlyn - <a href="https://github.com/mjtamlyn">mjtamlyn</a></li>
-<li>Richard Wackerbarth - <a href="https://github.com/wackerbarth">wackerbarth</a></li>
-<li>Johannes Spielmann - <a href="https://github.com/shezi">shezi</a></li>
-<li>James Cleveland - <a href="https://github.com/radiosilence">radiosilence</a></li>
-<li>Steve Gregory - <a href="https://github.com/steve-gregory">steve-gregory</a></li>
-<li>Federico Capoano - <a href="https://github.com/nemesisdesign">nemesisdesign</a></li>
-<li>Bruno Renié - <a href="https://github.com/brutasse">brutasse</a></li>
-<li>Kevin Stone - <a href="https://github.com/kevinastone">kevinastone</a></li>
-<li>Guglielmo Celata - <a href="https://github.com/guglielmo">guglielmo</a></li>
-<li>Mike Tums - <a href="https://github.com/mktums">mktums</a></li>
-<li>Michael Elovskikh - <a href="https://github.com/wronglink">wronglink</a></li>
-<li>Michał Jaworski - <a href="https://github.com/swistakm">swistakm</a></li>
-<li>Andrea de Marco - <a href="https://github.com/z4r">z4r</a></li>
-<li>Fernando Rocha - <a href="https://github.com/fernandogrd">fernandogrd</a></li>
-<li>Xavier Ordoquy - <a href="https://github.com/xordoquy">xordoquy</a></li>
-<li>Adam Wentz - <a href="https://github.com/floppya">floppya</a></li>
-<li>Andreas Pelme - <a href="https://github.com/pelme">pelme</a></li>
-<li>Ryan Detzel - <a href="https://github.com/ryanrdetzel">ryanrdetzel</a></li>
-<li>Omer Katz - <a href="https://github.com/thedrow">thedrow</a></li>
-<li>Wiliam Souza - <a href="https://github.com/wiliamsouza">waa</a></li>
-<li>Jonas Braun - <a href="https://github.com/iekadou">iekadou</a></li>
-<li>Ian Dash - <a href="https://github.com/bitmonkey">bitmonkey</a></li>
-<li>Bouke Haarsma - <a href="https://github.com/bouke">bouke</a></li>
-<li>Pierre Dulac - <a href="https://github.com/dulaccc">dulaccc</a></li>
-<li>Dave Kuhn - <a href="https://github.com/kuhnza">kuhnza</a></li>
-<li>Sitong Peng - <a href="https://github.com/stoneg">stoneg</a></li>
-<li>Victor Shih - <a href="https://github.com/vshih">vshih</a></li>
-<li>Atle Frenvik Sveen - <a href="https://github.com/atlefren">atlefren</a></li>
-<li>J Paul Reed - <a href="https://github.com/preed">preed</a></li>
-<li>Matt Majewski - <a href="https://github.com/forgingdestiny">forgingdestiny</a></li>
-<li>Jerome Chen - <a href="https://github.com/chenjyw">chenjyw</a></li>
-<li>Andrew Hughes - <a href="https://github.com/eyepulp">eyepulp</a></li>
-<li>Daniel Hepper - <a href="https://github.com/dhepper">dhepper</a></li>
-<li>Hamish Campbell - <a href="https://github.com/hamishcampbell">hamishcampbell</a></li>
-<li>Marlon Bailey - <a href="https://github.com/avinash240">avinash240</a></li>
-<li>James Summerfield - <a href="https://github.com/jsummerfield">jsummerfield</a></li>
-<li>Andy Freeland - <a href="https://github.com/rouge8">rouge8</a></li>
-<li>Craig de Stigter - <a href="https://github.com/craigds">craigds</a></li>
-<li>Pablo Recio - <a href="https://github.com/pyriku">pyriku</a></li>
-<li>Brian Zambrano - <a href="https://github.com/brianz">brianz</a></li>
-<li>Ã’scar Vilaplana - <a href="https://github.com/grimborg">grimborg</a></li>
-<li>Ryan Kaskel - <a href="https://github.com/ryankask">ryankask</a></li>
-<li>Andy McKay - <a href="https://github.com/andymckay">andymckay</a></li>
-<li>Matteo Suppo - <a href="https://github.com/matteosuppo">matteosuppo</a></li>
-<li>Karol Majta - <a href="https://github.com/lolek09">lolek09</a></li>
-<li>David Jones - <a href="https://github.com/commonorgarden">commonorgarden</a></li>
-<li>Andrew Tarzwell - <a href="https://github.com/atarzwell">atarzwell</a></li>
-<li>Michal Dvořák - <a href="https://github.com/mikee2185">mikee2185</a></li>
-<li>Markus Törnqvist - <a href="https://github.com/mjtorn">mjtorn</a></li>
-<li>Pascal Borreli - <a href="https://github.com/pborreli">pborreli</a></li>
-<li>Alex Burgel - <a href="https://github.com/aburgel">aburgel</a></li>
-<li>David Medina - <a href="https://github.com/copitux">copitux</a></li>
-<li>Areski Belaid - <a href="https://github.com/areski">areski</a></li>
-<li>Ethan Freman - <a href="https://github.com/mindlace">mindlace</a></li>
-<li>David Sanders - <a href="https://github.com/davesque">davesque</a></li>
-<li>Philip Douglas - <a href="https://github.com/freakydug">freakydug</a></li>
-<li>Igor Kalat - <a href="https://github.com/trwired">trwired</a></li>
-<li>Rudolf Olah - <a href="https://github.com/omouse">omouse</a></li>
-<li>Gertjan Oude Lohuis - <a href="https://github.com/gertjanol">gertjanol</a></li>
-<li>Matthias Jacob - <a href="https://github.com/cyroxx">cyroxx</a></li>
-<li>Pavel Zinovkin - <a href="https://github.com/pzinovkin">pzinovkin</a></li>
-<li>Will Kahn-Greene - <a href="https://github.com/willkg">willkg</a></li>
-<li>Kevin Brown - <a href="https://github.com/kevin-brown">kevin-brown</a></li>
-<li>Rodrigo Martell - <a href="https://github.com/coderigo">coderigo</a></li>
-<li>James Rutherford - <a href="https://github.com/jimr">jimr</a></li>
-<li>Ricky Rosario - <a href="https://github.com/rlr">rlr</a></li>
-<li>Veronica Lynn - <a href="https://github.com/kolvia">kolvia</a></li>
-<li>Dan Stephenson - <a href="https://github.com/etos">etos</a></li>
-<li>Martin Clement - <a href="https://github.com/martync">martync</a></li>
-<li>Jeremy Satterfield - <a href="https://github.com/jsatt">jsatt</a></li>
-<li>Christopher Paolini - <a href="https://github.com/chrispaolini">chrispaolini</a></li>
-<li>Filipe A Ximenes - <a href="https://github.com/filipeximenes">filipeximenes</a></li>
-<li>Ramiro Morales - <a href="https://github.com/ramiro">ramiro</a></li>
-<li>Krzysztof Jurewicz - <a href="https://github.com/krzysiekj">krzysiekj</a></li>
-<li>Eric Buehl - <a href="https://github.com/ericbuehl">ericbuehl</a></li>
-<li>Kristian Øllegaard - <a href="https://github.com/kristianoellegaard">kristianoellegaard</a></li>
-<li>Alexander Akhmetov - <a href="https://github.com/alexander-akhmetov">alexander-akhmetov</a></li>
-<li>Andrey Antukh - <a href="https://github.com/niwibe">niwibe</a></li>
-<li>Mathieu Pillard - <a href="https://github.com/diox">diox</a></li>
-<li>Edmond Wong - <a href="https://github.com/edmondwong">edmondwong</a></li>
-<li>Ben Reilly - <a href="https://github.com/bwreilly">bwreilly</a></li>
-<li>Tai Lee - <a href="https://github.com/mrmachine">mrmachine</a></li>
-<li>Markus Kaiserswerth - <a href="https://github.com/mkai">mkai</a></li>
-<li>Henry Clifford - <a href="https://github.com/hcliff">hcliff</a></li>
-<li>Thomas Badaud - <a href="https://github.com/badale">badale</a></li>
-<li>Colin Huang - <a href="https://github.com/tamakisquare">tamakisquare</a></li>
-<li>Ross McFarland - <a href="https://github.com/ross">ross</a></li>
-<li>Jacek Bzdak - <a href="https://github.com/jbzdak">jbzdak</a></li>
-<li>Alexander Lukanin - <a href="https://github.com/alexanderlukanin13">alexanderlukanin13</a></li>
-<li>Yamila Moreno - <a href="https://github.com/yamila-moreno">yamila-moreno</a></li>
-<li>Rob Hudson - <a href="https://github.com/robhudson">robhudson</a></li>
-<li>Alex Good - <a href="https://github.com/alexjg">alexjg</a></li>
-<li>Ian Foote - <a href="https://github.com/ian-foote">ian-foote</a></li>
-<li>Chuck Harmston - <a href="https://github.com/chuckharmston">chuckharmston</a></li>
-<li>Philip Forget - <a href="https://github.com/philipforget">philipforget</a></li>
-<li>Artem Mezhenin - <a href="https://github.com/amezhenin">amezhenin</a></li>
-</ul>
-<p>Many thanks to everyone who's contributed to the project.</p>
-<h2 id="additional-thanks">Additional thanks</h2>
-<p>The documentation is built with <a href="http://twitter.github.com/bootstrap/">Bootstrap</a> and <a href="http://daringfireball.net/projects/markdown/">Markdown</a>.</p>
-<p>Project hosting is with <a href="https://github.com/tomchristie/django-rest-framework">GitHub</a>.</p>
-<p>Continuous integration testing is managed with <a href="https://secure.travis-ci.org/tomchristie/django-rest-framework">Travis CI</a>.</p>
-<p>The <a href="http://restframework.herokuapp.com/">live sandbox</a> is hosted on <a href="http://www.heroku.com/">Heroku</a>.</p>
-<p>Various inspiration taken from the <a href="http://rubyonrails.org/">Rails</a>, <a href="https://bitbucket.org/jespern/django-piston">Piston</a>, <a href="https://github.com/toastdriven/django-tastypie">Tastypie</a>, <a href="https://github.com/zacharyvoase/dagny">Dagny</a> and <a href="https://github.com/BertrandBordage/django-viewsets">django-viewsets</a> projects.</p>
-<p>Development of REST framework 2.0 was sponsored by <a href="http://lab.dabapps.com">DabApps</a>.</p>
-<h2 id="contact">Contact</h2>
-<p>For usage questions please see the <a href="https://groups.google.com/forum/?fromgroups#!forum/django-rest-framework">REST framework discussion group</a>.</p>
-<p>You can also contact <a href="http://twitter.com/_tomchristie">@_tomchristie</a> directly on twitter.</p>
-
- </div>
- <!--/span-->
- </div>
- <!--/row-->
- </div>
- <!--/.fluid-container-->
- </div>
- <!--/.body content-->
- <div id="push"></div>
- </div>
- <!--/.wrapper -->
-
- <footer class="span12">
- <p>Documentation built with <a href="http://www.mkdocs.org/">MkDocs</a>.</a>
- </p>
- </footer>
-
- <!-- Le javascript
- ================================================== -->
- <!-- Placed at the end of the document so the pages load faster -->
- <script src="../../js/jquery-1.8.1-min.js"></script>
- <script src="../../js/prettify-1.0.js"></script>
- <script src="../../js/bootstrap-2.1.1-min.js"></script>
- <script src="../../js/theme.js"></script>
-
- <script>
- //$('.side-nav').scrollspy()
- var shiftWindow = function() {
- scrollBy(0, -50)
- };
- if (location.hash) shiftWindow();
- window.addEventListener("hashchange", shiftWindow);
-
- $('.dropdown-menu').on('click touchstart', function(event) {
- event.stopPropagation();
- });
-
- // Dynamically force sidenav to no higher than browser window
- $('.side-nav').css('max-height', window.innerHeight - 130);
-
- $(function() {
- $(window).resize(function() {
- $('.side-nav').css('max-height', window.innerHeight - 130);
- });
- });
- </script>
-</body>
-
-</html> \ No newline at end of file
diff --git a/topics/documenting-your-api/index.html b/topics/documenting-your-api/index.html
index c40302fc..1b0d9af2 100644
--- a/topics/documenting-your-api/index.html
+++ b/topics/documenting-your-api/index.html
@@ -62,7 +62,7 @@
<div class="navbar-inner">
<div class="container-fluid">
<a class="repo-link btn btn-primary btn-small" href="https://github.com/tomchristie/django-rest-framework/tree/master">GitHub</a>
- <a class="repo-link btn btn-inverse btn-small " rel="prev" href="../ajax-csrf-cors">
+ <a class="repo-link btn btn-inverse btn-small " rel="prev" href="../internationalization">
Next <i class="icon-arrow-right icon-white"></i>
</a>
<a class="repo-link btn btn-inverse btn-small " rel="next" href="../../api-guide/settings">
@@ -189,6 +189,10 @@
</li>
<li >
+ <a href="../../api-guide/versioning">Versioning</a>
+ </li>
+
+ <li >
<a href="../../api-guide/content-negotiation">Content negotiation</a>
</li>
@@ -232,6 +236,10 @@
</li>
<li >
+ <a href="../internationalization">Internationalization</a>
+ </li>
+
+ <li >
<a href="../ajax-csrf-cors">AJAX, CSRF & CORS</a>
</li>
@@ -260,23 +268,11 @@
</li>
<li >
- <a href="../rest-framework-2-announcement">2.0 Announcement</a>
- </li>
-
- <li >
- <a href="../2.2-announcement">2.2 Announcement</a>
- </li>
-
- <li >
- <a href="../2.3-announcement">2.3 Announcement</a>
- </li>
-
- <li >
- <a href="../2.4-announcement">2.4 Announcement</a>
+ <a href="../3.0-announcement">3.0 Announcement</a>
</li>
<li >
- <a href="../3.0-announcement">3.0 Announcement</a>
+ <a href="../3.1-announcement">3.1 Announcement</a>
</li>
<li >
@@ -287,10 +283,6 @@
<a href="../release-notes">Release Notes</a>
</li>
- <li >
- <a href="../credits">Credits</a>
- </li>
-
</ul>
</li>
diff --git a/topics/rest-framework-2-announcement/index.html b/topics/internationalization/index.html
index 18935f20..45ae801f 100644
--- a/topics/rest-framework-2-announcement/index.html
+++ b/topics/internationalization/index.html
@@ -4,11 +4,11 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
- <title>2.0 Announcement - Django REST framework</title>
+ <title>Internationalization - Django REST framework</title>
<link href="../../img/favicon.ico" rel="icon" type="image/x-icon">
- <link rel="canonical" href="http://www.django-rest-framework.org/topics/rest-framework-2-announcement/" />
+ <link rel="canonical" href="http://www.django-rest-framework.org/topics/internationalization/" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta name="description" content="Django, API, REST, 2.0 Announcement">
+ <meta name="description" content="Django, API, REST, Internationalization">
<meta name="author" content="Tom Christie">
<!-- Le styles -->
@@ -62,10 +62,10 @@
<div class="navbar-inner">
<div class="container-fluid">
<a class="repo-link btn btn-primary btn-small" href="https://github.com/tomchristie/django-rest-framework/tree/master">GitHub</a>
- <a class="repo-link btn btn-inverse btn-small " rel="prev" href="../2.2-announcement">
+ <a class="repo-link btn btn-inverse btn-small " rel="prev" href="../ajax-csrf-cors">
Next <i class="icon-arrow-right icon-white"></i>
</a>
- <a class="repo-link btn btn-inverse btn-small " rel="next" href="../project-management">
+ <a class="repo-link btn btn-inverse btn-small " rel="next" href="../documenting-your-api">
<i class="icon-arrow-left icon-white"></i> Previous
</a>
<a class="repo-link btn btn-inverse btn-small" href="#searchModal" data-toggle="modal"><i class="icon-search icon-white"></i> Search</a>
@@ -189,6 +189,10 @@
</li>
<li >
+ <a href="../../api-guide/versioning">Versioning</a>
+ </li>
+
+ <li >
<a href="../../api-guide/content-negotiation">Content negotiation</a>
</li>
@@ -231,6 +235,10 @@
<a href="../documenting-your-api">Documenting your API</a>
</li>
+ <li class="active" >
+ <a href=".">Internationalization</a>
+ </li>
+
<li >
<a href="../ajax-csrf-cors">AJAX, CSRF & CORS</a>
</li>
@@ -259,24 +267,12 @@
<a href="../project-management">Project management</a>
</li>
- <li class="active" >
- <a href=".">2.0 Announcement</a>
- </li>
-
<li >
- <a href="../2.2-announcement">2.2 Announcement</a>
- </li>
-
- <li >
- <a href="../2.3-announcement">2.3 Announcement</a>
- </li>
-
- <li >
- <a href="../2.4-announcement">2.4 Announcement</a>
+ <a href="../3.0-announcement">3.0 Announcement</a>
</li>
<li >
- <a href="../3.0-announcement">3.0 Announcement</a>
+ <a href="../3.1-announcement">3.1 Announcement</a>
</li>
<li >
@@ -287,10 +283,6 @@
<a href="../release-notes">Release Notes</a>
</li>
- <li >
- <a href="../credits">Credits</a>
- </li>
-
</ul>
</li>
@@ -353,40 +345,20 @@
<li class="main">
- <a href="#django-rest-framework-20">Django REST framework 2.0</a>
+ <a href="#internationalization">Internationalization</a>
</li>
<li>
- <a href="#user-feedback">User feedback</a>
- </li>
-
- <li>
- <a href="#serialization">Serialization</a>
- </li>
-
- <li>
- <a href="#generic-views">Generic views</a>
- </li>
-
- <li>
- <a href="#requests-responses-views">Requests, Responses &amp; Views</a>
+ <a href="#enabling-internationalized-apis">Enabling internationalized APIs</a>
</li>
<li>
- <a href="#api-design">API Design</a>
+ <a href="#adding-new-translations">Adding new translations</a>
</li>
<li>
- <a href="#the-browsable-api">The Browsable API</a>
- </li>
-
- <li>
- <a href="#documentation">Documentation</a>
- </li>
-
- <li>
- <a href="#summary">Summary</a>
+ <a href="#how-the-language-is-determined">How the language is determined</a>
</li>
@@ -402,57 +374,95 @@
<div id="main-content" class="span9">
- <h1 id="django-rest-framework-20">Django REST framework 2.0</h1>
+ <h1 id="internationalization">Internationalization</h1>
<blockquote>
-<p>Most people just make the mistake that it should be simple to design simple things. In reality, the effort required to design something is inversely proportional to the simplicity of the result.</p>
-<p>&mdash; <a href="http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven#comment-724">Roy Fielding</a></p>
+<p>Supporting internationalization is not optional. It must be a core feature.</p>
+<p>&mdash; <a href="http://youtu.be/Wa0VfS2q94Y">Jannis Leidel, speaking at Django Under the Hood, 2015</a>.</p>
</blockquote>
-<hr />
-<p><strong>Announcement:</strong> REST framework 2 released - Tue 30th Oct 2012</p>
-<hr />
-<p>REST framework 2 is an almost complete reworking of the original framework, which comprehensively addresses some of the original design issues.</p>
-<p>Because the latest version should be considered a re-release, rather than an incremental improvement, we've skipped a version, and called this release Django REST framework 2.0.</p>
-<p>This article is intended to give you a flavor of what REST framework 2 is, and why you might want to give it a try.</p>
-<h2 id="user-feedback">User feedback</h2>
-<p>Before we get cracking, let's start with the hard sell, with a few bits of feedback from some early adopters…</p>
-<p>"Django REST framework 2 is beautiful. Some of the API design is worthy of @kennethreitz." - <a href="https://twitter.com/kobutsu/status/261689665952833536">Kit La Touche</a></p>
-<p>"Since it's pretty much just Django, controlling things like URLs has been a breeze... I think [REST framework 2] has definitely got the right approach here; even simple things like being able to override a function called post to do custom work during rather than having to intimately know what happens during a post make a huge difference to your productivity." - <a href="https://groups.google.com/d/msg/django-rest-framework/heRGHzG6BWQ/ooVURgpwVC0J">Ian Strachan</a></p>
-<p>"I switched to the 2.0 branch and I don't regret it - fully refactored my code in another &half; day and it's <em>much</em> more to my tastes" - <a href="https://groups.google.com/d/msg/django-rest-framework/flsXbvYqRoY/9lSyntOf5cUJ">Bruno Desthuilliers</a></p>
-<p>Sounds good, right? Let's get into some details...</p>
-<h2 id="serialization">Serialization</h2>
-<p>REST framework 2 includes a totally re-worked serialization engine, that was initially intended as a replacement for Django's existing inflexible fixture serialization, and which meets the following design goals:</p>
+<p>REST framework ships with translatable error messages. You can make these appear in your language enabling <a href="https://docs.djangoproject.com/en/1.7/topics/i18n/translation">Django's standard translation mechanisms</a>.</p>
+<p>Doing so will allow you to:</p>
+<ul>
+<li>Select a language other than English as the default, using the standard <code>LANGUAGE_CODE</code> Django setting.</li>
+<li>Allow clients to choose a language themselves, using the <code>LocaleMiddleware</code> included with Django. A typical usage for API clients would be to include an <code>Accept-Language</code> request header.</li>
+</ul>
+<h2 id="enabling-internationalized-apis">Enabling internationalized APIs</h2>
+<p>You can change the default language by using the standard Django <code>LANGUAGE_CODE</code> setting:</p>
+<pre><code>LANGUAGE_CODE = "es-es"
+</code></pre>
+<p>You can turn on per-request language requests by adding <code>LocalMiddleware</code> to your <code>MIDDLEWARE_CLASSES</code> setting:</p>
+<pre><code>MIDDLEWARE_CLASSES = [
+ ...
+ 'django.middleware.locale.LocaleMiddleware'
+]
+</code></pre>
+<p>When per-request internationalization is enabled, client requests will respect the <code>Accept-Language</code> header where possible. For example, let's make a request for an unsupported media type:</p>
+<p><strong>Request</strong></p>
+<pre><code>GET /api/users HTTP/1.1
+Accept: application/xml
+Accept-Language: es-es
+Host: example.org
+</code></pre>
+<p><strong>Response</strong></p>
+<pre><code>HTTP/1.0 406 NOT ACCEPTABLE
+
+{"detail": "No se ha podido satisfacer la solicitud de cabecera de Accept."}
+</code></pre>
+<p>REST framework includes these built-in translations both for standard exception cases, and for serializer validation errors.</p>
+<p>Note that the translations only apply to the error strings themselves. The format of error messages, and the keys of field names will remain the same. An example <code>400 Bad Request</code> response body might look like this:</p>
+<pre><code>{"detail": {"username": ["Esse campo deve ser unico."]}}
+</code></pre>
+<p>If you want to use different string for parts of the response such as <code>detail</code> and <code>non_field_errors</code> then you can modify this behavior by using a <a href="../../api-guide/exceptions#custom-exception-handling">custom exception handler</a>.</p>
+<h4 id="specifying-the-set-of-supported-languages">Specifying the set of supported languages.</h4>
+<p>By default all available languages will be supported.</p>
+<p>If you only wish to support a subset of the available languages, use Django's standard <code>LANGUAGES</code> setting:</p>
+<pre><code>LANGUAGES = [
+ ('de', _('German')),
+ ('en', _('English')),
+]
+</code></pre>
+<h2 id="adding-new-translations">Adding new translations</h2>
+<p>REST framework translations are managed online using <a href="https://www.transifex.com/projects/p/django-rest-framework/">Transifex</a>. You can use the Transifex service to add new translation languages. The maintenance team will then ensure that these translation strings are included in the REST framework package.</p>
+<p>Sometimes you may need to add translation strings to your project locally. You may need to do this if:</p>
<ul>
-<li>A declarative serialization API, that mirrors Django's <code>Forms</code>/<code>ModelForms</code> API.</li>
-<li>Structural concerns are decoupled from encoding concerns.</li>
-<li>Able to support rendering and parsing to many formats, including both machine-readable representations and HTML forms.</li>
-<li>Validation that can be mapped to obvious and comprehensive error responses.</li>
-<li>Serializers that support both nested, flat, and partially-nested representations.</li>
-<li>Relationships that can be expressed as primary keys, hyperlinks, slug fields, and other custom representations.</li>
+<li>You want to use REST Framework in a language which has not been translated yet on Transifex.</li>
+<li>Your project includes custom error messages, which are not part of REST framework's default translation strings.</li>
</ul>
-<p>Mapping between the internal state of the system and external representations of that state is the core concern of building Web APIs. Designing serializers that allow the developer to do so in a flexible and obvious way is a deceptively difficult design task, and with the new serialization API we think we've pretty much nailed it.</p>
-<h2 id="generic-views">Generic views</h2>
-<p>When REST framework was initially released at the start of 2011, the current Django release was version 1.2. REST framework included a backport of Django 1.3's upcoming <code>View</code> class, but it didn't take full advantage of the generic view implementations.</p>
-<p>With the new release the generic views in REST framework now tie in with Django's generic views. The end result is that framework is clean, lightweight and easy to use.</p>
-<h2 id="requests-responses-views">Requests, Responses &amp; Views</h2>
-<p>REST framework 2 includes <code>Request</code> and <code>Response</code> classes, than are used in place of Django's existing <code>HttpRequest</code> and <code>HttpResponse</code> classes. Doing so allows logic such as parsing the incoming request or rendering the outgoing response to be supported transparently by the framework.</p>
-<p>The <code>Request</code>/<code>Response</code> approach leads to a much cleaner API, less logic in the view itself, and a simple, obvious request-response cycle.</p>
-<p>REST framework 2 also allows you to work with both function-based and class-based views. For simple API views all you need is a single <code>@api_view</code> decorator, and you're good to go.</p>
-<h2 id="api-design">API Design</h2>
-<p>Pretty much every aspect of REST framework has been reworked, with the aim of ironing out some of the design flaws of the previous versions. Each of the components of REST framework are cleanly decoupled, and can be used independently of each-other, and there are no monolithic resource classes, overcomplicated mixin combinations, or opinionated serialization or URL routing decisions.</p>
-<h2 id="the-browsable-api">The Browsable API</h2>
-<p>Django REST framework's most unique feature is the way it is able to serve up both machine-readable representations, and a fully browsable HTML representation to the same endpoints.</p>
-<p>Browsable Web APIs are easier to work with, visualize and debug, and generally makes it easier and more frictionless to inspect and work with.</p>
-<p>With REST framework 2, the browsable API gets a snazzy new bootstrap-based theme that looks great and is even nicer to work with.</p>
-<p>There are also some functionality improvements - actions such as as <code>POST</code> and <code>DELETE</code> will only display if the user has the appropriate permissions.</p>
-<p><img alt="Browsable API" src="../../../img/quickstart.png" /></p>
-<p><strong>Image above</strong>: An example of the browsable API in REST framework 2</p>
-<h2 id="documentation">Documentation</h2>
-<p>As you can see the documentation for REST framework has been radically improved. It gets a completely new style, using markdown for the documentation source, and a bootstrap-based theme for the styling.</p>
-<p>We're really pleased with how the docs style looks - it's simple and clean, is easy to navigate around, and we think it reads great.</p>
-<h2 id="summary">Summary</h2>
-<p>In short, we've engineered the hell outta this thing, and we're incredibly proud of the result.</p>
-<p>If you're interested please take a browse around the documentation. <a href="../../tutorial/1-serialization">The tutorial</a> is a great place to get started.</p>
-<p>There's also a <a href="http://restframework.herokuapp.com/">live sandbox version of the tutorial API</a> available for testing.</p>
+<h4 id="translating-a-new-language-locally">Translating a new language locally</h4>
+<p>This guide assumes you are already familiar with how to translate a Django app. If you're not, start by reading <a href="https://docs.djangoproject.com/en/1.7/topics/i18n/translation">Django's translation docs</a>.</p>
+<p>If you're translating a new language you'll need to translate the existing REST framework error messages:</p>
+<ol>
+<li>
+<p>Make a new folder where you want to store the internationalization resources. Add this path to your <a href="https://docs.djangoproject.com/en/1.7/ref/settings/#std:setting-LOCALE_PATHS"><code>LOCALE_PATHS</code></a> setting.</p>
+</li>
+<li>
+<p>Now create a subfolder for the language you want to translate. The folder should be named using <a href="https://docs.djangoproject.com/en/1.7/topics/i18n/#term-locale-name">locale name</a> notation. For example: <code>de</code>, <code>pt_BR</code>, <code>es_AR</code>.</p>
+</li>
+<li>
+<p>Now copy the <a href="https://raw.githubusercontent.com/tomchristie/django-rest-framework/master/rest_framework/locale/en_US/LC_MESSAGES/django.po">base translations file</a> from the REST framework source code into your translations folder.</p>
+</li>
+<li>
+<p>Edit the <code>django.po</code> file you've just copied, translating all the error messages.</p>
+</li>
+<li>
+<p>Run <code>manage.py compilemessages -l pt_BR</code> to make the translations
+available for Django to use. You should see a message like <code>processing file django.po in &lt;...&gt;/locale/pt_BR/LC_MESSAGES</code>.</p>
+</li>
+<li>
+<p>Restart your development server to see the changes take effect.</p>
+</li>
+</ol>
+<p>If you're only translating custom error messages that exist inside your project codebase you don't need to copy the REST framework source <code>django.po</code> file into a <code>LOCALE_PATHS</code> folder, and can instead simply run Django's standard <code>makemessages</code> process.</p>
+<h2 id="how-the-language-is-determined">How the language is determined</h2>
+<p>If you want to allow per-request language preferences you'll need to include <code>django.middleware.locale.LocaleMiddleware</code> in your <code>MIDDLEWARE_CLASSES</code> setting.</p>
+<p>You can find more information on how the language preference is determined in the <a href="https://docs.djangoproject.com/en/1.7/topics/i18n/translation/#how-django-discovers-language-preference">Django documentation</a>. For reference, the method is:</p>
+<ol>
+<li>First, it looks for the language prefix in the requested URL.</li>
+<li>Failing that, it looks for the <code>LANGUAGE_SESSION_KEY</code> key in the current user’s session.</li>
+<li>Failing that, it looks for a cookie.</li>
+<li>Failing that, it looks at the <code>Accept-Language</code> HTTP header.</li>
+<li>Failing that, it uses the global <code>LANGUAGE_CODE</code> setting.</li>
+</ol>
+<p>For API clients the most appropriate of these will typically be to use the <code>Accept-Language</code> header; Sessions and cookies will not be available unless using session authentication, and generally better practice to prefer an <code>Accept-Language</code> header for API clients rather than using language URL prefixes.</p>
</div>
<!--/span-->
diff --git a/topics/kickstarter-announcement/index.html b/topics/kickstarter-announcement/index.html
index f736ad9c..2fbbaaa4 100644
--- a/topics/kickstarter-announcement/index.html
+++ b/topics/kickstarter-announcement/index.html
@@ -65,7 +65,7 @@
<a class="repo-link btn btn-inverse btn-small " rel="prev" href="../release-notes">
Next <i class="icon-arrow-right icon-white"></i>
</a>
- <a class="repo-link btn btn-inverse btn-small " rel="next" href="../3.0-announcement">
+ <a class="repo-link btn btn-inverse btn-small " rel="next" href="../3.1-announcement">
<i class="icon-arrow-left icon-white"></i> Previous
</a>
<a class="repo-link btn btn-inverse btn-small" href="#searchModal" data-toggle="modal"><i class="icon-search icon-white"></i> Search</a>
@@ -189,6 +189,10 @@
</li>
<li >
+ <a href="../../api-guide/versioning">Versioning</a>
+ </li>
+
+ <li >
<a href="../../api-guide/content-negotiation">Content negotiation</a>
</li>
@@ -232,6 +236,10 @@
</li>
<li >
+ <a href="../internationalization">Internationalization</a>
+ </li>
+
+ <li >
<a href="../ajax-csrf-cors">AJAX, CSRF & CORS</a>
</li>
@@ -260,23 +268,11 @@
</li>
<li >
- <a href="../rest-framework-2-announcement">2.0 Announcement</a>
- </li>
-
- <li >
- <a href="../2.2-announcement">2.2 Announcement</a>
- </li>
-
- <li >
- <a href="../2.3-announcement">2.3 Announcement</a>
- </li>
-
- <li >
- <a href="../2.4-announcement">2.4 Announcement</a>
+ <a href="../3.0-announcement">3.0 Announcement</a>
</li>
<li >
- <a href="../3.0-announcement">3.0 Announcement</a>
+ <a href="../3.1-announcement">3.1 Announcement</a>
</li>
<li class="active" >
@@ -287,10 +283,6 @@
<a href="../release-notes">Release Notes</a>
</li>
- <li >
- <a href="../credits">Credits</a>
- </li>
-
</ul>
</li>
diff --git a/topics/project-management/index.html b/topics/project-management/index.html
index 91fa2359..cc7135ac 100644
--- a/topics/project-management/index.html
+++ b/topics/project-management/index.html
@@ -62,7 +62,7 @@
<div class="navbar-inner">
<div class="container-fluid">
<a class="repo-link btn btn-primary btn-small" href="https://github.com/tomchristie/django-rest-framework/tree/master">GitHub</a>
- <a class="repo-link btn btn-inverse btn-small " rel="prev" href="../rest-framework-2-announcement">
+ <a class="repo-link btn btn-inverse btn-small " rel="prev" href="../3.0-announcement">
Next <i class="icon-arrow-right icon-white"></i>
</a>
<a class="repo-link btn btn-inverse btn-small " rel="next" href="../contributing">
@@ -189,6 +189,10 @@
</li>
<li >
+ <a href="../../api-guide/versioning">Versioning</a>
+ </li>
+
+ <li >
<a href="../../api-guide/content-negotiation">Content negotiation</a>
</li>
@@ -232,6 +236,10 @@
</li>
<li >
+ <a href="../internationalization">Internationalization</a>
+ </li>
+
+ <li >
<a href="../ajax-csrf-cors">AJAX, CSRF & CORS</a>
</li>
@@ -260,23 +268,11 @@
</li>
<li >
- <a href="../rest-framework-2-announcement">2.0 Announcement</a>
- </li>
-
- <li >
- <a href="../2.2-announcement">2.2 Announcement</a>
- </li>
-
- <li >
- <a href="../2.3-announcement">2.3 Announcement</a>
- </li>
-
- <li >
- <a href="../2.4-announcement">2.4 Announcement</a>
+ <a href="../3.0-announcement">3.0 Announcement</a>
</li>
<li >
- <a href="../3.0-announcement">3.0 Announcement</a>
+ <a href="../3.1-announcement">3.1 Announcement</a>
</li>
<li >
@@ -287,10 +283,6 @@
<a href="../release-notes">Release Notes</a>
</li>
- <li >
- <a href="../credits">Credits</a>
- </li>
-
</ul>
</li>
@@ -366,6 +358,14 @@
</li>
<li>
+ <a href="#translations">Translations</a>
+ </li>
+
+ <li>
+ <a href="#project-requirements">Project requirements</a>
+ </li>
+
+ <li>
<a href="#project-ownership">Project ownership</a>
</li>
@@ -438,10 +438,11 @@ To modify this process for future maintenance cycles make a pull request to the
<h4 id="responsibilities-of-team-members">Responsibilities of team members</h4>
<p>Team members have the following responsibilities.</p>
<ul>
-<li>Add triage labels and milestones to tickets.</li>
<li>Close invalid or resolved tickets.</li>
+<li>Add triage labels and milestones to tickets.</li>
<li>Merge finalized pull requests.</li>
<li>Build and deploy the documentation, using <code>mkdocs gh-deploy</code>.</li>
+<li>Build and update the included translation packs.</li>
</ul>
<p>Further notes for maintainers:</p>
<ul>
@@ -482,6 +483,48 @@ To modify this process for future releases make a pull request to the [project m
</code></pre>
<p>When pushing the release to PyPI ensure that your environment has been installed from our development <code>requirement.txt</code>, so that documentation and PyPI installs are consistently being built against a pinned set of packages.</p>
<hr />
+<h2 id="translations">Translations</h2>
+<p>The maintenance team are responsible for managing the translation packs include in REST framework. Translating the source strings into multiple languages is managed through the <a href="https://www.transifex.com/projects/p/django-rest-framework/">transifex service</a>.</p>
+<h3 id="managing-transifex">Managing Transifex</h3>
+<p>The <a href="https://pypi.python.org/pypi/transifex-client">official Transifex client</a> is used to upload and download translations to Transifex. The client is installed using pip:</p>
+<pre><code>pip install transifex-client
+</code></pre>
+<p>To use it you'll need a login to Transifex which has a password, and you'll need to have administrative access to the Transifex project. You'll need to create a <code>~/.transifexrc</code> file which contains your credentials.</p>
+<pre><code>[https://www.transifex.com]
+username = ***
+token = ***
+password = ***
+hostname = https://www.transifex.com
+</code></pre>
+<h3 id="upload-new-source-files">Upload new source files</h3>
+<p>When any user visible strings are changed, they should be uploaded to Transifex so that the translators can start to translate them. To do this, just run:</p>
+<pre><code># 1. Update the source django.po file, which is the US English version.
+cd rest_framework
+django-admin.py makemessages -l en_US
+# 2. Push the source django.po file to Transifex.
+cd ..
+tx push -s
+</code></pre>
+<p>When pushing source files, Transifex will update the source strings of a resource to match those from the new source file.</p>
+<p>Here's how differences between the old and new source files will be handled:</p>
+<ul>
+<li>New strings will be added.</li>
+<li>Modified strings will be added as well.</li>
+<li>Strings which do not exist in the new source file will be removed from the database, along with their translations. If that source strings gets re-added later then <a href="http://docs.transifex.com/guides/tm#let-tm-automatically-populate-translations">Transifex Translation Memory</a> will automatically include the translation string.</li>
+</ul>
+<h3 id="download-translations">Download translations</h3>
+<p>When a translator has finished translating their work needs to be downloaded from Transifex into the REST framework repository. To do this, run:</p>
+<pre><code># 3. Pull the translated django.po files from Transifex.
+tx pull -a
+cd rest_framework
+# 4. Compile the binary .mo files for all supported languages.
+django-admin.py compilemessages
+</code></pre>
+<hr />
+<h2 id="project-requirements">Project requirements</h2>
+<p>All our test requirements are pinned to exact versions, in order to ensure that our test runs are reproducible. We maintain the requirements in the <code>requirements</code> directory. The requirements files are referenced from the <code>tox.ini</code> configuration file, ensuring we have a single source of truth for package versions used in testing.</p>
+<p>Package upgrades should generally be treated as isolated pull requests. You can check if there are any packages available at a newer version, by using the <code>pip list --outdated</code>.</p>
+<hr />
<h2 id="project-ownership">Project ownership</h2>
<p>The PyPI package is owned by <code>@tomchristie</code>. As a backup <code>@j4mie</code> also has ownership of the package.</p>
<p>If <code>@tomchristie</code> ceases to participate in the project then <code>@j4mie</code> has responsibility for handing over ownership duties.</p>
diff --git a/topics/release-notes/index.html b/topics/release-notes/index.html
index 2d66b25f..5e0a86b9 100644
--- a/topics/release-notes/index.html
+++ b/topics/release-notes/index.html
@@ -62,7 +62,7 @@
<div class="navbar-inner">
<div class="container-fluid">
<a class="repo-link btn btn-primary btn-small" href="https://github.com/tomchristie/django-rest-framework/tree/master">GitHub</a>
- <a class="repo-link btn btn-inverse btn-small " rel="prev" href="../credits">
+ <a class="repo-link btn btn-inverse btn-small disabled" rel="prev" >
Next <i class="icon-arrow-right icon-white"></i>
</a>
<a class="repo-link btn btn-inverse btn-small " rel="next" href="../kickstarter-announcement">
@@ -189,6 +189,10 @@
</li>
<li >
+ <a href="../../api-guide/versioning">Versioning</a>
+ </li>
+
+ <li >
<a href="../../api-guide/content-negotiation">Content negotiation</a>
</li>
@@ -232,6 +236,10 @@
</li>
<li >
+ <a href="../internationalization">Internationalization</a>
+ </li>
+
+ <li >
<a href="../ajax-csrf-cors">AJAX, CSRF & CORS</a>
</li>
@@ -260,23 +268,11 @@
</li>
<li >
- <a href="../rest-framework-2-announcement">2.0 Announcement</a>
- </li>
-
- <li >
- <a href="../2.2-announcement">2.2 Announcement</a>
- </li>
-
- <li >
- <a href="../2.3-announcement">2.3 Announcement</a>
- </li>
-
- <li >
- <a href="../2.4-announcement">2.4 Announcement</a>
+ <a href="../3.0-announcement">3.0 Announcement</a>
</li>
<li >
- <a href="../3.0-announcement">3.0 Announcement</a>
+ <a href="../3.1-announcement">3.1 Announcement</a>
</li>
<li >
@@ -287,10 +283,6 @@
<a href=".">Release Notes</a>
</li>
- <li >
- <a href="../credits">Credits</a>
- </li>
-
</ul>
</li>
@@ -373,26 +365,6 @@
<a href="#30x-series">3.0.x series</a>
</li>
- <li>
- <a href="#24x-series">2.4.x series</a>
- </li>
-
- <li>
- <a href="#23x-series">2.3.x series</a>
- </li>
-
- <li>
- <a href="#22x-series">2.2.x series</a>
- </li>
-
- <li>
- <a href="#21x-series">2.1.x series</a>
- </li>
-
- <li>
- <a href="#20x-series">2.0.x series</a>
- </li>
-
@@ -439,6 +411,9 @@
</code></pre>
<hr />
<h2 id="30x-series">3.0.x series</h2>
+<h3 id="310">3.1.0</h3>
+<p><strong>Date</strong>: [5th March 2015][3.1.0-milestone].</p>
+<p>For full details see the <a href="../3.1-announcement">3.1 release announcement</a>.</p>
<h3 id="305">3.0.5</h3>
<p><strong>Date</strong>: <a href="https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.0.5+Release%22">10th February 2015</a>.</p>
<ul>
@@ -526,509 +501,7 @@
<p><strong>Date</strong>: 1st December 2014</p>
<p>For full details see the <a href="../3.0-announcement">3.0 release announcement</a>.</p>
<hr />
-<h2 id="24x-series">2.4.x series</h2>
-<h3 id="244">2.4.4</h3>
-<p><strong>Date</strong>: <a href="https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%222.4.4+Release%22+">3rd November 2014</a>.</p>
-<ul>
-<li><strong>Security fix</strong>: Escape URLs when replacing <code>format=</code> query parameter, as used in dropdown on <code>GET</code> button in browsable API to allow explicit selection of JSON vs HTML output.</li>
-<li>Maintain ordering of URLs in API root view for <code>DefaultRouter</code>.</li>
-<li>Fix <code>follow=True</code> in <code>APIRequestFactory</code></li>
-<li>Resolve issue with invalid <code>read_only=True</code>, <code>required=True</code> fields being automatically generated by <code>ModelSerializer</code> in some cases.</li>
-<li>Resolve issue with <code>OPTIONS</code> requests returning incorrect information for views using <code>get_serializer_class</code> to dynamically determine serializer based on request method. </li>
-</ul>
-<h3 id="243">2.4.3</h3>
-<p><strong>Date</strong>: <a href="https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%222.4.3+Release%22+">19th September 2014</a>.</p>
-<ul>
-<li>Support translatable view docstrings being displayed in the browsable API.</li>
-<li>Support <a href="http://tools.ietf.org/html/rfc6266#section-4.3">encoded <code>filename*</code></a> in raw file uploads with <code>FileUploadParser</code>.</li>
-<li>Allow routers to support viewsets that don't include any list routes or that don't include any detail routes.</li>
-<li>Don't render an empty login control in browsable API if <code>login</code> view is not included.</li>
-<li>CSRF exemption performed in <code>.as_view()</code> to prevent accidental omission if overriding <code>.dispatch()</code>.</li>
-<li>Login on browsable API now displays validation errors.</li>
-<li>Bugfix: Fix migration in <code>authtoken</code> application.</li>
-<li>Bugfix: Allow selection of integer keys in nested choices.</li>
-<li>Bugfix: Return <code>None</code> instead of <code>'None'</code> in <code>CharField</code> with <code>allow_none=True</code>.</li>
-<li>Bugfix: Ensure custom model fields map to equivelent serializer fields more reliably.</li>
-<li>Bugfix: <code>DjangoFilterBackend</code> no longer quietly changes queryset ordering.</li>
-</ul>
-<h3 id="242">2.4.2</h3>
-<p><strong>Date</strong>: <a href="https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%222.4.2+Release%22+">3rd September 2014</a>.</p>
-<ul>
-<li>Bugfix: Fix broken pagination for 2.4.x series.</li>
-</ul>
-<h3 id="241">2.4.1</h3>
-<p><strong>Date</strong>: <a href="https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%222.4.1+Release%22+">1st September 2014</a>.</p>
-<ul>
-<li>Bugfix: Fix broken login template for browsable API.</li>
-</ul>
-<h3 id="240">2.4.0</h3>
-<p><strong>Date</strong>: <a href="https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%222.4.0+Release%22+">29th August 2014</a>.</p>
-<p><strong>Django version requirements</strong>: The lowest supported version of Django is now 1.4.2.</p>
-<p><strong>South version requirements</strong>: This note applies to any users using the optional <code>authtoken</code> application, which includes an associated database migration. You must now <em>either</em> upgrade your <code>south</code> package to version 1.0, <em>or</em> instead use the built-in migration support available with Django 1.7.</p>
-<ul>
-<li>Added compatibility with Django 1.7's database migration support.</li>
-<li>New test runner, using <code>py.test</code>.</li>
-<li>Deprecated <code>.model</code> view attribute in favor of explicit <code>.queryset</code> and <code>.serializer_class</code> attributes. The <code>DEFAULT_MODEL_SERIALIZER_CLASS</code> setting is also deprecated.</li>
-<li><code>@detail_route</code> and <code>@list_route</code> decorators replace <code>@action</code> and <code>@link</code>.</li>
-<li>Support customizable view name and description functions, using the <code>VIEW_NAME_FUNCTION</code> and <code>VIEW_DESCRIPTION_FUNCTION</code> settings.</li>
-<li>Added <code>NUM_PROXIES</code> setting for smarter client IP identification.</li>
-<li>Added <code>MAX_PAGINATE_BY</code> setting and <code>max_paginate_by</code> generic view attribute.</li>
-<li>Added <code>Retry-After</code> header to throttled responses, as per <a href="http://tools.ietf.org/html/rfc6585">RFC 6585</a>. This should now be used in preference to the custom <code>X-Trottle-Wait-Seconds</code> header which will be fully deprecated in 3.0.</li>
-<li>Added <code>cache</code> attribute to throttles to allow overriding of default cache.</li>
-<li>Added <code>lookup_value_regex</code> attribute to routers, to allow the URL argument matching to be constrainted by the user.</li>
-<li>Added <code>allow_none</code> option to <code>CharField</code>.</li>
-<li>Support Django's standard <code>status_code</code> class attribute on responses.</li>
-<li>More intuitive behavior on the test client, as <code>client.logout()</code> now also removes any credentials that have been set.</li>
-<li>Bugfix: <code>?page_size=0</code> query parameter now falls back to default page size for view, instead of always turning pagination off.</li>
-<li>Bugfix: Always uppercase <code>X-Http-Method-Override</code> methods.</li>
-<li>Bugfix: Copy <code>filter_backends</code> list before returning it, in order to prevent view code from mutating the class attribute itself.</li>
-<li>Bugfix: Set the <code>.action</code> attribute on viewsets when introspected by <code>OPTIONS</code> for testing permissions on the view.</li>
-<li>Bugfix: Ensure <code>ValueError</code> raised during deserialization results in a error list rather than a single error. This is now consistent with other validation errors.</li>
-<li>Bugfix: Fix <code>cache_format</code> typo on throttle classes, was <code>"throtte_%(scope)s_%(ident)s"</code>. Note that this will invalidate existing throttle caches.</li>
-</ul>
-<hr />
-<h2 id="23x-series">2.3.x series</h2>
-<h3 id="2314">2.3.14</h3>
-<p><strong>Date</strong>: 12th June 2014</p>
-<ul>
-<li><strong>Security fix</strong>: Escape request path when it is include as part of the login and logout links in the browsable API.</li>
-<li><code>help_text</code> and <code>verbose_name</code> automatically set for related fields on <code>ModelSerializer</code>.</li>
-<li>Fix nested serializers linked through a backward foreign key relation.</li>
-<li>Fix bad links for the <code>BrowsableAPIRenderer</code> with <code>YAMLRenderer</code>.</li>
-<li>Add <code>UnicodeYAMLRenderer</code> that extends <code>YAMLRenderer</code> with unicode.</li>
-<li>Fix <code>parse_header</code> argument convertion.</li>
-<li>Fix mediatype detection under Python 3.</li>
-<li>Web browsable API now offers blank option on dropdown when the field is not required.</li>
-<li><code>APIException</code> representation improved for logging purposes.</li>
-<li>Allow source="*" within nested serializers.</li>
-<li>Better support for custom oauth2 provider backends.</li>
-<li>Fix field validation if it's optional and has no value.</li>
-<li>Add <code>SEARCH_PARAM</code> and <code>ORDERING_PARAM</code>.</li>
-<li>Fix <code>APIRequestFactory</code> to support arguments within the url string for GET.</li>
-<li>Allow three transport modes for access tokens when accessing a protected resource.</li>
-<li>Fix <code>QueryDict</code> encoding on request objects.</li>
-<li>Ensure throttle keys do not contain spaces, as those are invalid if using <code>memcached</code>.</li>
-<li>Support <code>blank_display_value</code> on <code>ChoiceField</code>.</li>
-</ul>
-<h3 id="2313">2.3.13</h3>
-<p><strong>Date</strong>: 6th March 2014</p>
-<ul>
-<li>Django 1.7 Support.</li>
-<li>Fix <code>default</code> argument when used with serializer relation fields.</li>
-<li>Display the media type of the content that is being displayed in the browsable API, rather than 'text/html'.</li>
-<li>Bugfix for <code>urlize</code> template failure when URL regex is matched, but value does not <code>urlparse</code>.</li>
-<li>Use <code>urandom</code> for token generation.</li>
-<li>Only use <code>Vary: Accept</code> when more than one renderer exists.</li>
-</ul>
-<h3 id="2312">2.3.12</h3>
-<p><strong>Date</strong>: 15th January 2014</p>
-<ul>
-<li><strong>Security fix</strong>: <code>OrderingField</code> now only allows ordering on readable serializer fields, or on fields explicitly specified using <code>ordering_fields</code>. This prevents users being able to order by fields that are not visible in the API, and exploiting the ordering of sensitive data such as password hashes.</li>
-<li>Bugfix: <code>write_only = True</code> fields now display in the browsable API.</li>
-</ul>
-<h3 id="2311">2.3.11</h3>
-<p><strong>Date</strong>: 14th January 2014</p>
-<ul>
-<li>Added <code>write_only</code> serializer field argument.</li>
-<li>Added <code>write_only_fields</code> option to <code>ModelSerializer</code> classes.</li>
-<li>JSON renderer now deals with objects that implement a dict-like interface.</li>
-<li>Fix compatiblity with newer versions of <code>django-oauth-plus</code>.</li>
-<li>Bugfix: Refine behavior that calls model manager <code>all()</code> across nested serializer relationships, preventing erronous behavior with some non-ORM objects, and preventing unnecessary queryset re-evaluations.</li>
-<li>Bugfix: Allow defaults on BooleanFields to be properly honored when values are not supplied.</li>
-<li>Bugfix: Prevent double-escaping of non-latin1 URL query params when appending <code>format=json</code> params.</li>
-</ul>
-<h3 id="2310">2.3.10</h3>
-<p><strong>Date</strong>: 6th December 2013</p>
-<ul>
-<li>Add in choices information for ChoiceFields in response to <code>OPTIONS</code> requests.</li>
-<li>Added <code>pre_delete()</code> and <code>post_delete()</code> method hooks.</li>
-<li>Added status code category helper functions.</li>
-<li>Bugfix: Partial updates which erronously set a related field to <code>None</code> now correctly fail validation instead of raising an exception.</li>
-<li>Bugfix: Responses without any content no longer include an HTTP <code>'Content-Type'</code> header.</li>
-<li>Bugfix: Correctly handle validation errors in PUT-as-create case, responding with 400.</li>
-</ul>
-<h3 id="239">2.3.9</h3>
-<p><strong>Date</strong>: 15th November 2013</p>
-<ul>
-<li>Fix Django 1.6 exception API compatibility issue caused by <code>ValidationError</code>.</li>
-<li>Include errors in HTML forms in browsable API.</li>
-<li>Added JSON renderer support for numpy scalars.</li>
-<li>Added <code>transform_&lt;fieldname&gt;</code> hooks on serializers for easily modifying field output.</li>
-<li>Added <code>get_context</code> hook in <code>BrowsableAPIRenderer</code>.</li>
-<li>Allow serializers to be passed <code>files</code> but no <code>data</code>.</li>
-<li><code>HTMLFormRenderer</code> now renders serializers directly to HTML without needing to create an intermediate form object.</li>
-<li>Added <code>get_filter_backends</code> hook.</li>
-<li>Added queryset aggregates to allowed fields in <code>OrderingFilter</code>.</li>
-<li>Bugfix: Fix decimal suppoprt with <code>YAMLRenderer</code>.</li>
-<li>Bugfix: Fix submission of unicode in browsable API through raw data form.</li>
-</ul>
-<h3 id="238">2.3.8</h3>
-<p><strong>Date</strong>: 11th September 2013</p>
-<ul>
-<li>Added <code>DjangoObjectPermissions</code>, and <code>DjangoObjectPermissionsFilter</code>.</li>
-<li>Support customizable exception handling, using the <code>EXCEPTION_HANDLER</code> setting.</li>
-<li>Support customizable view name and description functions, using the <code>VIEW_NAME_FUNCTION</code> and <code>VIEW_DESCRIPTION_FUNCTION</code> settings.</li>
-<li>Added <code>MAX_PAGINATE_BY</code> setting and <code>max_paginate_by</code> generic view attribute.</li>
-<li>Added <code>cache</code> attribute to throttles to allow overriding of default cache.</li>
-<li>'Raw data' tab in browsable API now contains pre-populated data.</li>
-<li>'Raw data' and 'HTML form' tab preference in browsable API now saved between page views.</li>
-<li>Bugfix: <code>required=True</code> argument fixed for boolean serializer fields.</li>
-<li>Bugfix: <code>client.force_authenticate(None)</code> should also clear session info if it exists.</li>
-<li>Bugfix: Client sending empty string instead of file now clears <code>FileField</code>.</li>
-<li>Bugfix: Empty values on ChoiceFields with <code>required=False</code> now consistently return <code>None</code>.</li>
-<li>Bugfix: Clients setting <code>page_size=0</code> now simply returns the default page size, instead of disabling pagination. [*]</li>
-</ul>
-<hr />
-<p>[*] Note that the change in <code>page_size=0</code> behaviour fixes what is considered to be a bug in how clients can effect the pagination size. However if you were relying on this behavior you will need to add the following mixin to your list views in order to preserve the existing behavior.</p>
-<pre><code>class DisablePaginationMixin(object):
- def get_paginate_by(self, queryset=None):
- if self.request.QUERY_PARAMS[self.paginate_by_param] == '0':
- return None
- return super(DisablePaginationMixin, self).get_paginate_by(queryset)
-</code></pre>
-<hr />
-<h3 id="237">2.3.7</h3>
-<p><strong>Date</strong>: 16th August 2013</p>
-<ul>
-<li>Added <code>APITestClient</code>, <code>APIRequestFactory</code> and <code>APITestCase</code> etc...</li>
-<li>Refactor <code>SessionAuthentication</code> to allow esier override for CSRF exemption.</li>
-<li>Remove 'Hold down "Control" message from help_text' widget messaging when not appropriate.</li>
-<li>Added admin configuration for auth tokens.</li>
-<li>Bugfix: <code>AnonRateThrottle</code> fixed to not throttle authenticated users.</li>
-<li>Bugfix: Don't set <code>X-Throttle-Wait-Seconds</code> when throttle does not have <code>wait</code> value.</li>
-<li>Bugfix: Fixed <code>PATCH</code> button title in browsable API.</li>
-<li>Bugfix: Fix issue with OAuth2 provider naive datetimes.</li>
-</ul>
-<h3 id="236">2.3.6</h3>
-<p><strong>Date</strong>: 27th June 2013</p>
-<ul>
-<li>Added <code>trailing_slash</code> option to routers.</li>
-<li>Include support for <code>HttpStreamingResponse</code>.</li>
-<li>Support wider range of default serializer validation when used with custom model fields.</li>
-<li>UTF-8 Support for browsable API descriptions.</li>
-<li>OAuth2 provider uses timezone aware datetimes when supported.</li>
-<li>Bugfix: Return error correctly when OAuth non-existent consumer occurs.</li>
-<li>Bugfix: Allow <code>FileUploadParser</code> to correctly filename if provided as URL kwarg.</li>
-<li>Bugfix: Fix <code>ScopedRateThrottle</code>.</li>
-</ul>
-<h3 id="235">2.3.5</h3>
-<p><strong>Date</strong>: 3rd June 2013</p>
-<ul>
-<li>Added <code>get_url</code> hook to <code>HyperlinkedIdentityField</code>.</li>
-<li>Serializer field <code>default</code> argument may be a callable.</li>
-<li><code>@action</code> decorator now accepts a <code>methods</code> argument.</li>
-<li>Bugfix: <code>request.user</code> should be still be accessible in renderer context if authentication fails.</li>
-<li>Bugfix: The <code>lookup_field</code> option on <code>HyperlinkedIdentityField</code> should apply by default to the url field on the serializer.</li>
-<li>Bugfix: <code>HyperlinkedIdentityField</code> should continue to support <code>pk_url_kwarg</code>, <code>slug_url_kwarg</code>, <code>slug_field</code>, in a pending deprecation state.</li>
-<li>Bugfix: Ensure we always return 404 instead of 500 if a lookup field cannot be converted to the correct lookup type. (Eg non-numeric <code>AutoInteger</code> pk lookup)</li>
-</ul>
-<h3 id="234">2.3.4</h3>
-<p><strong>Date</strong>: 24th May 2013</p>
-<ul>
-<li>Serializer fields now support <code>label</code> and <code>help_text</code>.</li>
-<li>Added <code>UnicodeJSONRenderer</code>.</li>
-<li><code>OPTIONS</code> requests now return metadata about fields for <code>POST</code> and <code>PUT</code> requests.</li>
-<li>Bugfix: <code>charset</code> now properly included in <code>Content-Type</code> of responses.</li>
-<li>Bugfix: Blank choice now added in browsable API on nullable relationships.</li>
-<li>Bugfix: Many to many relationships with <code>through</code> tables are now read-only.</li>
-<li>Bugfix: Serializer fields now respect model field args such as <code>max_length</code>.</li>
-<li>Bugfix: SlugField now performs slug validation.</li>
-<li>Bugfix: Lazy-translatable strings now properly serialized.</li>
-<li>Bugfix: Browsable API now supports bootswatch styles properly.</li>
-<li>Bugfix: HyperlinkedIdentityField now uses <code>lookup_field</code> kwarg.</li>
-</ul>
-<p><strong>Note</strong>: Responses now correctly include an appropriate charset on the <code>Content-Type</code> header. For example: <code>application/json; charset=utf-8</code>. If you have tests that check the content type of responses, you may need to update these accordingly.</p>
-<h3 id="233">2.3.3</h3>
-<p><strong>Date</strong>: 16th May 2013</p>
-<ul>
-<li>Added SearchFilter</li>
-<li>Added OrderingFilter</li>
-<li>Added GenericViewSet</li>
-<li>Bugfix: Multiple <code>@action</code> and <code>@link</code> methods now allowed on viewsets.</li>
-<li>Bugfix: Fix API Root view issue with DjangoModelPermissions</li>
-</ul>
-<h3 id="232">2.3.2</h3>
-<p><strong>Date</strong>: 8th May 2013</p>
-<ul>
-<li>Bugfix: Fix <code>TIME_FORMAT</code>, <code>DATETIME_FORMAT</code> and <code>DATE_FORMAT</code> settings.</li>
-<li>Bugfix: Fix <code>DjangoFilterBackend</code> issue, failing when used on view with queryset attribute.</li>
-</ul>
-<h3 id="231">2.3.1</h3>
-<p><strong>Date</strong>: 7th May 2013</p>
-<ul>
-<li>Bugfix: Fix breadcrumb rendering issue.</li>
-</ul>
-<h3 id="230">2.3.0</h3>
-<p><strong>Date</strong>: 7th May 2013</p>
-<ul>
-<li>ViewSets and Routers.</li>
-<li>ModelSerializers support reverse relations in 'fields' option.</li>
-<li>HyperLinkedModelSerializers support 'id' field in 'fields' option.</li>
-<li>Cleaner generic views.</li>
-<li>Support for multiple filter classes.</li>
-<li>FileUploadParser support for raw file uploads.</li>
-<li>DecimalField support.</li>
-<li>Made Login template easier to restyle.</li>
-<li>Bugfix: Fix issue with depth&gt;1 on ModelSerializer.</li>
-</ul>
-<p><strong>Note</strong>: See the <a href="../2.3-announcement">2.3 announcement</a> for full details.</p>
-<hr />
-<h2 id="22x-series">2.2.x series</h2>
-<h3 id="227">2.2.7</h3>
-<p><strong>Date</strong>: 17th April 2013</p>
-<ul>
-<li>Loud failure when view does not return a <code>Response</code> or <code>HttpResponse</code>.</li>
-<li>Bugfix: Fix for Django 1.3 compatibility.</li>
-<li>Bugfix: Allow overridden <code>get_object()</code> to work correctly.</li>
-</ul>
-<h3 id="226">2.2.6</h3>
-<p><strong>Date</strong>: 4th April 2013</p>
-<ul>
-<li>OAuth2 authentication no longer requires unnecessary URL parameters in addition to the token.</li>
-<li>URL hyperlinking in browsable API now handles more cases correctly.</li>
-<li>Long HTTP headers in browsable API are broken in multiple lines when possible.</li>
-<li>Bugfix: Fix regression with DjangoFilterBackend not worthing correctly with single object views.</li>
-<li>Bugfix: OAuth should fail hard when invalid token used.</li>
-<li>Bugfix: Fix serializer potentially returning <code>None</code> object for models that define <code>__bool__</code> or <code>__len__</code>.</li>
-</ul>
-<h3 id="225">2.2.5</h3>
-<p><strong>Date</strong>: 26th March 2013</p>
-<ul>
-<li>Serializer support for bulk create and bulk update operations.</li>
-<li>Regression fix: Date and time fields return date/time objects by default. Fixes regressions caused by 2.2.2. See <a href="https://github.com/tomchristie/django-rest-framework/pull/743">#743</a> for more details.</li>
-<li>Bugfix: Fix 500 error is OAuth not attempted with OAuthAuthentication class installed.</li>
-<li><code>Serializer.save()</code> now supports arbitrary keyword args which are passed through to the object <code>.save()</code> method. Mixins use <code>force_insert</code> and <code>force_update</code> where appropriate, resulting in one less database query.</li>
-</ul>
-<h3 id="224">2.2.4</h3>
-<p><strong>Date</strong>: 13th March 2013</p>
-<ul>
-<li>OAuth 2 support.</li>
-<li>OAuth 1.0a support.</li>
-<li>Support X-HTTP-Method-Override header.</li>
-<li>Filtering backends are now applied to the querysets for object lookups as well as lists. (Eg you can use a filtering backend to control which objects should 404)</li>
-<li>Deal with error data nicely when deserializing lists of objects.</li>
-<li>Extra override hook to configure <code>DjangoModelPermissions</code> for unauthenticated users.</li>
-<li>Bugfix: Fix regression which caused extra database query on paginated list views.</li>
-<li>Bugfix: Fix pk relationship bug for some types of 1-to-1 relations.</li>
-<li>Bugfix: Workaround for Django bug causing case where <code>Authtoken</code> could be registered for cascade delete from <code>User</code> even if not installed.</li>
-</ul>
-<h3 id="223">2.2.3</h3>
-<p><strong>Date</strong>: 7th March 2013</p>
-<ul>
-<li>Bugfix: Fix None values for for <code>DateField</code>, <code>DateTimeField</code> and <code>TimeField</code>.</li>
-</ul>
-<h3 id="222">2.2.2</h3>
-<p><strong>Date</strong>: 6th March 2013</p>
-<ul>
-<li>Support for custom input and output formats for <code>DateField</code>, <code>DateTimeField</code> and <code>TimeField</code>.</li>
-<li>Cleanup: Request authentication is no longer lazily evaluated, instead authentication is always run, which results in more consistent, obvious behavior. Eg. Supplying bad auth credentials will now always return an error response, even if no permissions are set on the view.</li>
-<li>Bugfix for serializer data being uncacheable with pickle protocol 0.</li>
-<li>Bugfixes for model field validation edge-cases.</li>
-<li>Bugfix for authtoken migration while using a custom user model and south.</li>
-</ul>
-<h3 id="221">2.2.1</h3>
-<p><strong>Date</strong>: 22nd Feb 2013</p>
-<ul>
-<li>Security fix: Use <code>defusedxml</code> package to address XML parsing vulnerabilities.</li>
-<li>Raw data tab added to browsable API. (Eg. Allow for JSON input.)</li>
-<li>Added TimeField.</li>
-<li>Serializer fields can be mapped to any method that takes no args, or only takes kwargs which have defaults.</li>
-<li>Unicode support for view names/descriptions in browsable API.</li>
-<li>Bugfix: request.DATA should return an empty <code>QueryDict</code> with no data, not <code>None</code>.</li>
-<li>Bugfix: Remove unneeded field validation, which caused extra queries.</li>
-</ul>
-<p><strong>Security note</strong>: Following the <a href="http://blog.python.org/2013/02/announcing-defusedxml-fixes-for-xml.html">disclosure of security vulnerabilities</a> in Python's XML parsing libraries, use of the <code>XMLParser</code> class now requires the <code>defusedxml</code> package to be installed.</p>
-<p>The security vulnerabilities only affect APIs which use the <code>XMLParser</code> class, by enabling it in any views, or by having it set in the <code>DEFAULT_PARSER_CLASSES</code> setting. Note that the <code>XMLParser</code> class is not enabled by default, so this change should affect a minority of users.</p>
-<h3 id="220">2.2.0</h3>
-<p><strong>Date</strong>: 13th Feb 2013</p>
-<ul>
-<li>Python 3 support.</li>
-<li>Added a <code>post_save()</code> hook to the generic views.</li>
-<li>Allow serializers to handle dicts as well as objects.</li>
-<li>Deprecate <code>ManyRelatedField()</code> syntax in favor of <code>RelatedField(many=True)</code></li>
-<li>Deprecate <code>null=True</code> on relations in favor of <code>required=False</code>.</li>
-<li>Deprecate <code>blank=True</code> on CharFields, just use <code>required=False</code>.</li>
-<li>Deprecate optional <code>obj</code> argument in permissions checks in favor of <code>has_object_permission</code>.</li>
-<li>Deprecate implicit hyperlinked relations behavior.</li>
-<li>Bugfix: Fix broken DjangoModelPermissions.</li>
-<li>Bugfix: Allow serializer output to be cached.</li>
-<li>Bugfix: Fix styling on browsable API login.</li>
-<li>Bugfix: Fix issue with deserializing empty to-many relations.</li>
-<li>Bugfix: Ensure model field validation is still applied for ModelSerializer subclasses with an custom <code>.restore_object()</code> method.</li>
-</ul>
-<p><strong>Note</strong>: See the <a href="../2.2-announcement">2.2 announcement</a> for full details.</p>
-<hr />
-<h2 id="21x-series">2.1.x series</h2>
-<h3 id="2117">2.1.17</h3>
-<p><strong>Date</strong>: 26th Jan 2013</p>
-<ul>
-<li>Support proper 401 Unauthorized responses where appropriate, instead of always using 403 Forbidden.</li>
-<li>Support json encoding of timedelta objects.</li>
-<li><code>format_suffix_patterns()</code> now supports <code>include</code> style URL patterns.</li>
-<li>Bugfix: Fix issues with custom pagination serializers.</li>
-<li>Bugfix: Nested serializers now accept <code>source='*'</code> argument.</li>
-<li>Bugfix: Return proper validation errors when incorrect types supplied for relational fields.</li>
-<li>Bugfix: Support nullable FKs with <code>SlugRelatedField</code>.</li>
-<li>Bugfix: Don't call custom validation methods if the field has an error.</li>
-</ul>
-<p><strong>Note</strong>: If the primary authentication class is <code>TokenAuthentication</code> or <code>BasicAuthentication</code>, a view will now correctly return 401 responses to unauthenticated access, with an appropriate <code>WWW-Authenticate</code> header, instead of 403 responses.</p>
-<h3 id="2116">2.1.16</h3>
-<p><strong>Date</strong>: 14th Jan 2013</p>
-<ul>
-<li>Deprecate <code>django.utils.simplejson</code> in favor of Python 2.6's built-in json module.</li>
-<li>Bugfix: <code>auto_now</code>, <code>auto_now_add</code> and other <code>editable=False</code> fields now default to read-only.</li>
-<li>Bugfix: PK fields now only default to read-only if they are an AutoField or if <code>editable=False</code>.</li>
-<li>Bugfix: Validation errors instead of exceptions when serializers receive incorrect types.</li>
-<li>Bugfix: Validation errors instead of exceptions when related fields receive incorrect types.</li>
-<li>Bugfix: Handle ObjectDoesNotExist exception when serializing null reverse one-to-one</li>
-</ul>
-<p><strong>Note</strong>: Prior to 2.1.16, The Decimals would render in JSON using floating point if <code>simplejson</code> was installed, but otherwise render using string notation. Now that use of <code>simplejson</code> has been deprecated, Decimals will consistently render using string notation. See <a href="../../ticket-582">ticket 582</a> for more details.</p>
-<h3 id="2115">2.1.15</h3>
-<p><strong>Date</strong>: 3rd Jan 2013</p>
-<ul>
-<li>Added <code>PATCH</code> support.</li>
-<li>Added <code>RetrieveUpdateAPIView</code>.</li>
-<li>Remove unused internal <code>save_m2m</code> flag on <code>ModelSerializer.save()</code>.</li>
-<li>Tweak behavior of hyperlinked fields with an explicit format suffix.</li>
-<li>Relation changes are now persisted in <code>.save()</code> instead of in <code>.restore_object()</code>.</li>
-<li>Bugfix: Fix issue with FileField raising exception instead of validation error when files=None.</li>
-<li>Bugfix: Partial updates should not set default values if field is not included.</li>
-</ul>
-<h3 id="2114">2.1.14</h3>
-<p><strong>Date</strong>: 31st Dec 2012</p>
-<ul>
-<li>Bugfix: ModelSerializers now include reverse FK fields on creation.</li>
-<li>Bugfix: Model fields with <code>blank=True</code> are now <code>required=False</code> by default.</li>
-<li>Bugfix: Nested serializers now support nullable relationships.</li>
-</ul>
-<p><strong>Note</strong>: From 2.1.14 onwards, relational fields move out of the <code>fields.py</code> module and into the new <code>relations.py</code> module, in order to separate them from regular data type fields, such as <code>CharField</code> and <code>IntegerField</code>.</p>
-<p>This change will not affect user code, so long as it's following the recommended import style of <code>from rest_framework import serializers</code> and referring to fields using the style <code>serializers.PrimaryKeyRelatedField</code>.</p>
-<h3 id="2113">2.1.13</h3>
-<p><strong>Date</strong>: 28th Dec 2012</p>
-<ul>
-<li>Support configurable <code>STATICFILES_STORAGE</code> storage.</li>
-<li>Bugfix: Related fields now respect the required flag, and may be required=False.</li>
-</ul>
-<h3 id="2112">2.1.12</h3>
-<p><strong>Date</strong>: 21st Dec 2012</p>
-<ul>
-<li>Bugfix: Fix bug that could occur using ChoiceField.</li>
-<li>Bugfix: Fix exception in browsable API on DELETE.</li>
-<li>Bugfix: Fix issue where pk was was being set to a string if set by URL kwarg.</li>
-</ul>
-<h3 id="2111">2.1.11</h3>
-<p><strong>Date</strong>: 17th Dec 2012</p>
-<ul>
-<li>Bugfix: Fix issue with M2M fields in browsable API.</li>
-</ul>
-<h3 id="2110">2.1.10</h3>
-<p><strong>Date</strong>: 17th Dec 2012</p>
-<ul>
-<li>Bugfix: Ensure read-only fields don't have model validation applied.</li>
-<li>Bugfix: Fix hyperlinked fields in paginated results.</li>
-</ul>
-<h3 id="219">2.1.9</h3>
-<p><strong>Date</strong>: 11th Dec 2012</p>
-<ul>
-<li>Bugfix: Fix broken nested serialization.</li>
-<li>Bugfix: Fix <code>Meta.fields</code> only working as tuple not as list.</li>
-<li>Bugfix: Edge case if unnecessarily specifying <code>required=False</code> on read only field.</li>
-</ul>
-<h3 id="218">2.1.8</h3>
-<p><strong>Date</strong>: 8th Dec 2012</p>
-<ul>
-<li>Fix for creating nullable Foreign Keys with <code>''</code> as well as <code>None</code>.</li>
-<li>Added <code>null=&lt;bool&gt;</code> related field option.</li>
-</ul>
-<h3 id="217">2.1.7</h3>
-<p><strong>Date</strong>: 7th Dec 2012</p>
-<ul>
-<li>Serializers now properly support nullable Foreign Keys.</li>
-<li>Serializer validation now includes model field validation, such as uniqueness constraints.</li>
-<li>Support 'true' and 'false' string values for BooleanField.</li>
-<li>Added pickle support for serialized data.</li>
-<li>Support <code>source='dotted.notation'</code> style for nested serializers.</li>
-<li>Make <code>Request.user</code> settable.</li>
-<li>Bugfix: Fix <code>RegexField</code> to work with <code>BrowsableAPIRenderer</code>.</li>
-</ul>
-<h3 id="216">2.1.6</h3>
-<p><strong>Date</strong>: 23rd Nov 2012</p>
-<ul>
-<li>Bugfix: Unfix DjangoModelPermissions. (I am a doofus.)</li>
-</ul>
-<h3 id="215">2.1.5</h3>
-<p><strong>Date</strong>: 23rd Nov 2012</p>
-<ul>
-<li>Bugfix: Fix DjangoModelPermissions.</li>
-</ul>
-<h3 id="214">2.1.4</h3>
-<p><strong>Date</strong>: 22nd Nov 2012</p>
-<ul>
-<li>Support for partial updates with serializers.</li>
-<li>Added <code>RegexField</code>.</li>
-<li>Added <code>SerializerMethodField</code>.</li>
-<li>Serializer performance improvements.</li>
-<li>Added <code>obtain_token_view</code> to get tokens when using <code>TokenAuthentication</code>.</li>
-<li>Bugfix: Django 1.5 configurable user support for <code>TokenAuthentication</code>.</li>
-</ul>
-<h3 id="213">2.1.3</h3>
-<p><strong>Date</strong>: 16th Nov 2012</p>
-<ul>
-<li>Added <code>FileField</code> and <code>ImageField</code>. For use with <code>MultiPartParser</code>.</li>
-<li>Added <code>URLField</code> and <code>SlugField</code>.</li>
-<li>Support for <code>read_only_fields</code> on <code>ModelSerializer</code> classes.</li>
-<li>Support for clients overriding the pagination page sizes. Use the <code>PAGINATE_BY_PARAM</code> setting or set the <code>paginate_by_param</code> attribute on a generic view.</li>
-<li>201 Responses now return a 'Location' header.</li>
-<li>Bugfix: Serializer fields now respect <code>max_length</code>.</li>
-</ul>
-<h3 id="212">2.1.2</h3>
-<p><strong>Date</strong>: 9th Nov 2012</p>
-<ul>
-<li><strong>Filtering support.</strong></li>
-<li>Bugfix: Support creation of objects with reverse M2M relations.</li>
-</ul>
-<h3 id="211">2.1.1</h3>
-<p><strong>Date</strong>: 7th Nov 2012</p>
-<ul>
-<li>Support use of HTML exception templates. Eg. <code>403.html</code></li>
-<li>Hyperlinked fields take optional <code>slug_field</code>, <code>slug_url_kwarg</code> and <code>pk_url_kwarg</code> arguments.</li>
-<li>Bugfix: Deal with optional trailing slashes properly when generating breadcrumbs.</li>
-<li>Bugfix: Make textareas same width as other fields in browsable API.</li>
-<li>Private API change: <code>.get_serializer</code> now uses same <code>instance</code> and <code>data</code> ordering as serializer initialization.</li>
-</ul>
-<h3 id="210">2.1.0</h3>
-<p><strong>Date</strong>: 5th Nov 2012</p>
-<ul>
-<li><strong>Serializer <code>instance</code> and <code>data</code> keyword args have their position swapped.</strong></li>
-<li><code>queryset</code> argument is now optional on writable model fields.</li>
-<li>Hyperlinked related fields optionally take <code>slug_field</code> and <code>slug_url_kwarg</code> arguments.</li>
-<li>Support Django's cache framework.</li>
-<li>Minor field improvements. (Don't stringify dicts, more robust many-pk fields.)</li>
-<li>Bugfix: Support choice field in Browsable API.</li>
-<li>Bugfix: Related fields with <code>read_only=True</code> do not require a <code>queryset</code> argument.</li>
-</ul>
-<p><strong>API-incompatible changes</strong>: Please read <a href="https://groups.google.com/d/topic/django-rest-framework/Vv2M0CMY9bg/discussion">this thread</a> regarding the <code>instance</code> and <code>data</code> keyword args before updating to 2.1.0.</p>
-<hr />
-<h2 id="20x-series">2.0.x series</h2>
-<h3 id="202">2.0.2</h3>
-<p><strong>Date</strong>: 2nd Nov 2012</p>
-<ul>
-<li>Fix issues with pk related fields in the browsable API.</li>
-</ul>
-<h3 id="201">2.0.1</h3>
-<p><strong>Date</strong>: 1st Nov 2012</p>
-<ul>
-<li>Add support for relational fields in the browsable API.</li>
-<li>Added SlugRelatedField and ManySlugRelatedField.</li>
-<li>If PUT creates an instance return '201 Created', instead of '200 OK'.</li>
-</ul>
-<h3 id="200">2.0.0</h3>
-<p><strong>Date</strong>: 30th Oct 2012</p>
-<ul>
-<li><strong>Fix all of the things.</strong> (Well, almost.)</li>
-<li>For more information please see the <a href="../rest-framework-2-announcement">2.0 announcement</a>.</li>
-</ul>
-<p>For older release notes, <a href="../../old-release-notes">please see the GitHub repo</a>.</p>
+<p>For older release notes, <a href="../../old-release-notes">please see the version 2.x documentation</a>.</p>
<!-- 3.0.1 -->
<p><!-- 3.0.2 -->
diff --git a/topics/rest-hypermedia-hateoas/index.html b/topics/rest-hypermedia-hateoas/index.html
index 30e6c2b6..3cd57775 100644
--- a/topics/rest-hypermedia-hateoas/index.html
+++ b/topics/rest-hypermedia-hateoas/index.html
@@ -189,6 +189,10 @@
</li>
<li >
+ <a href="../../api-guide/versioning">Versioning</a>
+ </li>
+
+ <li >
<a href="../../api-guide/content-negotiation">Content negotiation</a>
</li>
@@ -232,6 +236,10 @@
</li>
<li >
+ <a href="../internationalization">Internationalization</a>
+ </li>
+
+ <li >
<a href="../ajax-csrf-cors">AJAX, CSRF & CORS</a>
</li>
@@ -260,23 +268,11 @@
</li>
<li >
- <a href="../rest-framework-2-announcement">2.0 Announcement</a>
- </li>
-
- <li >
- <a href="../2.2-announcement">2.2 Announcement</a>
- </li>
-
- <li >
- <a href="../2.3-announcement">2.3 Announcement</a>
- </li>
-
- <li >
- <a href="../2.4-announcement">2.4 Announcement</a>
+ <a href="../3.0-announcement">3.0 Announcement</a>
</li>
<li >
- <a href="../3.0-announcement">3.0 Announcement</a>
+ <a href="../3.1-announcement">3.1 Announcement</a>
</li>
<li >
@@ -287,10 +283,6 @@
<a href="../release-notes">Release Notes</a>
</li>
- <li >
- <a href="../credits">Credits</a>
- </li>
-
</ul>
</li>
diff --git a/topics/third-party-resources/index.html b/topics/third-party-resources/index.html
index c3ad6d8d..f015640e 100644
--- a/topics/third-party-resources/index.html
+++ b/topics/third-party-resources/index.html
@@ -189,6 +189,10 @@
</li>
<li >
+ <a href="../../api-guide/versioning">Versioning</a>
+ </li>
+
+ <li >
<a href="../../api-guide/content-negotiation">Content negotiation</a>
</li>
@@ -232,6 +236,10 @@
</li>
<li >
+ <a href="../internationalization">Internationalization</a>
+ </li>
+
+ <li >
<a href="../ajax-csrf-cors">AJAX, CSRF & CORS</a>
</li>
@@ -260,23 +268,11 @@
</li>
<li >
- <a href="../rest-framework-2-announcement">2.0 Announcement</a>
- </li>
-
- <li >
- <a href="../2.2-announcement">2.2 Announcement</a>
- </li>
-
- <li >
- <a href="../2.3-announcement">2.3 Announcement</a>
- </li>
-
- <li >
- <a href="../2.4-announcement">2.4 Announcement</a>
+ <a href="../3.0-announcement">3.0 Announcement</a>
</li>
<li >
- <a href="../3.0-announcement">3.0 Announcement</a>
+ <a href="../3.1-announcement">3.1 Announcement</a>
</li>
<li >
@@ -287,10 +283,6 @@
<a href="../release-notes">Release Notes</a>
</li>
- <li >
- <a href="../credits">Credits</a>
- </li>
-
</ul>
</li>
@@ -512,6 +504,7 @@ You probably want to also tag the version now:
<li><a href="https://github.com/kumar303/hawkrest">hawkrest</a> - Provides Hawk HTTP Authorization.</li>
<li><a href="https://github.com/etoccalino/django-rest-framework-httpsignature">djangorestframework-httpsignature</a> - Provides an easy to use HTTP Signature Authentication mechanism.</li>
<li><a href="https://github.com/sunscrapers/djoser">djoser</a> - Provides a set of views to handle basic actions such as registration, login, logout, password reset and account activation.</li>
+<li><a href="https://github.com/Tivix/django-rest-auth/">django-rest-auth</a> - Provides a set of REST API endpoints for registration, authentication (including social media authentication), password reset, retrieve and update user details, etc.</li>
</ul>
<h3 id="permissions">Permissions</h3>
<ul>