aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--api-guide/authentication.html2
-rw-r--r--api-guide/content-negotiation.html2
-rw-r--r--api-guide/exceptions.html9
-rw-r--r--api-guide/fields.html2
-rw-r--r--api-guide/filtering.html2
-rw-r--r--api-guide/format-suffixes.html2
-rw-r--r--api-guide/generic-views.html2
-rw-r--r--api-guide/pagination.html2
-rw-r--r--api-guide/parsers.html2
-rw-r--r--api-guide/permissions.html2
-rw-r--r--api-guide/relations.html2
-rw-r--r--api-guide/renderers.html2
-rw-r--r--api-guide/requests.html2
-rw-r--r--api-guide/responses.html2
-rw-r--r--api-guide/reverse.html2
-rw-r--r--api-guide/routers.html2
-rw-r--r--api-guide/serializers.html2
-rw-r--r--api-guide/settings.html2
-rw-r--r--api-guide/status-codes.html2
-rw-r--r--api-guide/testing.html2
-rw-r--r--api-guide/throttling.html2
-rw-r--r--api-guide/views.html2
-rw-r--r--api-guide/viewsets.html2
-rw-r--r--topics/2.2-announcement.html2
-rw-r--r--topics/2.3-announcement.html2
-rw-r--r--topics/ajax-csrf-cors.html2
-rw-r--r--topics/browsable-api.html2
-rw-r--r--topics/browser-enhancements.html2
-rw-r--r--topics/contributing.html2
-rw-r--r--topics/credits.html2
-rw-r--r--topics/documenting-your-api.html2
-rw-r--r--topics/release-notes.html3
-rw-r--r--topics/rest-framework-2-announcement.html2
-rw-r--r--topics/rest-hypermedia-hateoas.html2
-rw-r--r--topics/writable-nested-serializers.html2
-rw-r--r--tutorial/1-serialization.html8
-rw-r--r--tutorial/2-requests-and-responses.html8
-rw-r--r--tutorial/3-class-based-views.html2
-rw-r--r--tutorial/4-authentication-and-permissions.html6
-rw-r--r--tutorial/5-relationships-and-hyperlinked-apis.html2
-rw-r--r--tutorial/6-viewsets-and-routers.html2
-rw-r--r--tutorial/quickstart.html2
42 files changed, 56 insertions, 52 deletions
diff --git a/api-guide/authentication.html b/api-guide/authentication.html
index b0745359..3cefc360 100644
--- a/api-guide/authentication.html
+++ b/api-guide/authentication.html
@@ -2,7 +2,7 @@
<html lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
- <title>Django REST framework - Authentication</title>
+ <title>Authentication - Django REST framework</title>
<link href="http://django-rest-framework.org/img/favicon.ico" rel="icon" type="image/x-icon">
<link rel="canonical" href="http://django-rest-framework.org/api-guide/authentication"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
diff --git a/api-guide/content-negotiation.html b/api-guide/content-negotiation.html
index 83157c1e..8be70ee4 100644
--- a/api-guide/content-negotiation.html
+++ b/api-guide/content-negotiation.html
@@ -2,7 +2,7 @@
<html lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
- <title>Django REST framework - Content negotiation</title>
+ <title>Content negotiation - Django REST framework</title>
<link href="http://django-rest-framework.org/img/favicon.ico" rel="icon" type="image/x-icon">
<link rel="canonical" href="http://django-rest-framework.org/api-guide/content-negotiation"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
diff --git a/api-guide/exceptions.html b/api-guide/exceptions.html
index 161a69e1..c83a6a6d 100644
--- a/api-guide/exceptions.html
+++ b/api-guide/exceptions.html
@@ -2,7 +2,7 @@
<html lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
- <title>Django REST framework - Exceptions</title>
+ <title>Exceptions - Django REST framework</title>
<link href="http://django-rest-framework.org/img/favicon.ico" rel="icon" type="image/x-icon">
<link rel="canonical" href="http://django-rest-framework.org/api-guide/exceptions"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@@ -279,6 +279,13 @@ def custom_exception_handler(exc):
<p><strong>Signature:</strong> <code>APIException()</code></p>
<p>The <strong>base class</strong> for all exceptions raised inside REST framework.</p>
<p>To provide a custom exception, subclass <code>APIException</code> and set the <code>.status_code</code> and <code>.detail</code> properties on the class.</p>
+<p>For example, if your API relies on a third party service that may sometimes be unreachable, you might want to implement an exception for the "503 Service Unavailable" HTTP response code. You could do this like so:</p>
+<pre class="prettyprint lang-py"><code>from rest_framework.exceptions import APIException
+
+class ServiceUnavailable(APIException):
+ status_code = 503
+ detail = 'Service temporarily unavailable, try again later.'
+</code></pre>
<h2 id="parseerror">ParseError</h2>
<p><strong>Signature:</strong> <code>ParseError(detail=None)</code></p>
<p>Raised if the request contains malformed data when accessing <code>request.DATA</code> or <code>request.FILES</code>.</p>
diff --git a/api-guide/fields.html b/api-guide/fields.html
index 405792e3..6cbb7f12 100644
--- a/api-guide/fields.html
+++ b/api-guide/fields.html
@@ -2,7 +2,7 @@
<html lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
- <title>Django REST framework - Serializer fields</title>
+ <title>Serializer fields - Django REST framework</title>
<link href="http://django-rest-framework.org/img/favicon.ico" rel="icon" type="image/x-icon">
<link rel="canonical" href="http://django-rest-framework.org/api-guide/fields"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
diff --git a/api-guide/filtering.html b/api-guide/filtering.html
index 4921927a..221ed1a7 100644
--- a/api-guide/filtering.html
+++ b/api-guide/filtering.html
@@ -2,7 +2,7 @@
<html lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
- <title>Django REST framework - Filtering</title>
+ <title>Filtering - Django REST framework</title>
<link href="http://django-rest-framework.org/img/favicon.ico" rel="icon" type="image/x-icon">
<link rel="canonical" href="http://django-rest-framework.org/api-guide/filtering"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
diff --git a/api-guide/format-suffixes.html b/api-guide/format-suffixes.html
index 1b8cdae2..3137e705 100644
--- a/api-guide/format-suffixes.html
+++ b/api-guide/format-suffixes.html
@@ -2,7 +2,7 @@
<html lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
- <title>Django REST framework - Format suffixes</title>
+ <title>Format suffixes - Django REST framework</title>
<link href="http://django-rest-framework.org/img/favicon.ico" rel="icon" type="image/x-icon">
<link rel="canonical" href="http://django-rest-framework.org/api-guide/format-suffixes"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
diff --git a/api-guide/generic-views.html b/api-guide/generic-views.html
index df236846..c90330fc 100644
--- a/api-guide/generic-views.html
+++ b/api-guide/generic-views.html
@@ -2,7 +2,7 @@
<html lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
- <title>Django REST framework - Generic views</title>
+ <title>Generic views - Django REST framework</title>
<link href="http://django-rest-framework.org/img/favicon.ico" rel="icon" type="image/x-icon">
<link rel="canonical" href="http://django-rest-framework.org/api-guide/generic-views"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
diff --git a/api-guide/pagination.html b/api-guide/pagination.html
index 9bbd9a47..bda2b457 100644
--- a/api-guide/pagination.html
+++ b/api-guide/pagination.html
@@ -2,7 +2,7 @@
<html lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
- <title>Django REST framework - Pagination</title>
+ <title>Pagination - Django REST framework</title>
<link href="http://django-rest-framework.org/img/favicon.ico" rel="icon" type="image/x-icon">
<link rel="canonical" href="http://django-rest-framework.org/api-guide/pagination"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
diff --git a/api-guide/parsers.html b/api-guide/parsers.html
index 73e3539c..c0ce8d60 100644
--- a/api-guide/parsers.html
+++ b/api-guide/parsers.html
@@ -2,7 +2,7 @@
<html lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
- <title>Django REST framework - Parsers</title>
+ <title>Parsers - Django REST framework</title>
<link href="http://django-rest-framework.org/img/favicon.ico" rel="icon" type="image/x-icon">
<link rel="canonical" href="http://django-rest-framework.org/api-guide/parsers"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
diff --git a/api-guide/permissions.html b/api-guide/permissions.html
index 575ab99e..75275f32 100644
--- a/api-guide/permissions.html
+++ b/api-guide/permissions.html
@@ -2,7 +2,7 @@
<html lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
- <title>Django REST framework - Permissions</title>
+ <title>Permissions - Django REST framework</title>
<link href="http://django-rest-framework.org/img/favicon.ico" rel="icon" type="image/x-icon">
<link rel="canonical" href="http://django-rest-framework.org/api-guide/permissions"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
diff --git a/api-guide/relations.html b/api-guide/relations.html
index 7b4056db..d774972d 100644
--- a/api-guide/relations.html
+++ b/api-guide/relations.html
@@ -2,7 +2,7 @@
<html lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
- <title>Django REST framework - Serializer relations</title>
+ <title>Serializer relations - Django REST framework</title>
<link href="http://django-rest-framework.org/img/favicon.ico" rel="icon" type="image/x-icon">
<link rel="canonical" href="http://django-rest-framework.org/api-guide/relations"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
diff --git a/api-guide/renderers.html b/api-guide/renderers.html
index c68fe217..b98a27de 100644
--- a/api-guide/renderers.html
+++ b/api-guide/renderers.html
@@ -2,7 +2,7 @@
<html lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
- <title>Django REST framework - Renderers</title>
+ <title>Renderers - Django REST framework</title>
<link href="http://django-rest-framework.org/img/favicon.ico" rel="icon" type="image/x-icon">
<link rel="canonical" href="http://django-rest-framework.org/api-guide/renderers"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
diff --git a/api-guide/requests.html b/api-guide/requests.html
index d0d5704d..63753427 100644
--- a/api-guide/requests.html
+++ b/api-guide/requests.html
@@ -2,7 +2,7 @@
<html lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
- <title>Django REST framework - Requests</title>
+ <title>Requests - Django REST framework</title>
<link href="http://django-rest-framework.org/img/favicon.ico" rel="icon" type="image/x-icon">
<link rel="canonical" href="http://django-rest-framework.org/api-guide/requests"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
diff --git a/api-guide/responses.html b/api-guide/responses.html
index 286d7bfd..27a8d22d 100644
--- a/api-guide/responses.html
+++ b/api-guide/responses.html
@@ -2,7 +2,7 @@
<html lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
- <title>Django REST framework - Responses</title>
+ <title>Responses - Django REST framework</title>
<link href="http://django-rest-framework.org/img/favicon.ico" rel="icon" type="image/x-icon">
<link rel="canonical" href="http://django-rest-framework.org/api-guide/responses"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
diff --git a/api-guide/reverse.html b/api-guide/reverse.html
index 434b2fd0..7db25193 100644
--- a/api-guide/reverse.html
+++ b/api-guide/reverse.html
@@ -2,7 +2,7 @@
<html lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
- <title>Django REST framework - Returning URLs</title>
+ <title>Returning URLs - Django REST framework</title>
<link href="http://django-rest-framework.org/img/favicon.ico" rel="icon" type="image/x-icon">
<link rel="canonical" href="http://django-rest-framework.org/api-guide/reverse"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
diff --git a/api-guide/routers.html b/api-guide/routers.html
index c4477541..028314bc 100644
--- a/api-guide/routers.html
+++ b/api-guide/routers.html
@@ -2,7 +2,7 @@
<html lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
- <title>Django REST framework - Routers</title>
+ <title>Routers - Django REST framework</title>
<link href="http://django-rest-framework.org/img/favicon.ico" rel="icon" type="image/x-icon">
<link rel="canonical" href="http://django-rest-framework.org/api-guide/routers"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
diff --git a/api-guide/serializers.html b/api-guide/serializers.html
index ce04b3f3..70696b3a 100644
--- a/api-guide/serializers.html
+++ b/api-guide/serializers.html
@@ -2,7 +2,7 @@
<html lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
- <title>Django REST framework - Serializers</title>
+ <title>Serializers - Django REST framework</title>
<link href="http://django-rest-framework.org/img/favicon.ico" rel="icon" type="image/x-icon">
<link rel="canonical" href="http://django-rest-framework.org/api-guide/serializers"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
diff --git a/api-guide/settings.html b/api-guide/settings.html
index 10f16a23..d9e493d9 100644
--- a/api-guide/settings.html
+++ b/api-guide/settings.html
@@ -2,7 +2,7 @@
<html lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
- <title>Django REST framework - Settings</title>
+ <title>Settings - Django REST framework</title>
<link href="http://django-rest-framework.org/img/favicon.ico" rel="icon" type="image/x-icon">
<link rel="canonical" href="http://django-rest-framework.org/api-guide/settings"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
diff --git a/api-guide/status-codes.html b/api-guide/status-codes.html
index b6bfaadd..18a31fb2 100644
--- a/api-guide/status-codes.html
+++ b/api-guide/status-codes.html
@@ -2,7 +2,7 @@
<html lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
- <title>Django REST framework - Status Codes</title>
+ <title>Status Codes - Django REST framework</title>
<link href="http://django-rest-framework.org/img/favicon.ico" rel="icon" type="image/x-icon">
<link rel="canonical" href="http://django-rest-framework.org/api-guide/status-codes"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
diff --git a/api-guide/testing.html b/api-guide/testing.html
index 2eae0149..eb8d668c 100644
--- a/api-guide/testing.html
+++ b/api-guide/testing.html
@@ -2,7 +2,7 @@
<html lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
- <title>Django REST framework - Testing</title>
+ <title>Testing - Django REST framework</title>
<link href="http://django-rest-framework.org/img/favicon.ico" rel="icon" type="image/x-icon">
<link rel="canonical" href="http://django-rest-framework.org/api-guide/testing"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
diff --git a/api-guide/throttling.html b/api-guide/throttling.html
index 8800a02d..fc2dd14a 100644
--- a/api-guide/throttling.html
+++ b/api-guide/throttling.html
@@ -2,7 +2,7 @@
<html lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
- <title>Django REST framework - Throttling</title>
+ <title>Throttling - Django REST framework</title>
<link href="http://django-rest-framework.org/img/favicon.ico" rel="icon" type="image/x-icon">
<link rel="canonical" href="http://django-rest-framework.org/api-guide/throttling"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
diff --git a/api-guide/views.html b/api-guide/views.html
index c63f47ba..45828da8 100644
--- a/api-guide/views.html
+++ b/api-guide/views.html
@@ -2,7 +2,7 @@
<html lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
- <title>Django REST framework - Class Based Views</title>
+ <title>Class Based Views - Django REST framework</title>
<link href="http://django-rest-framework.org/img/favicon.ico" rel="icon" type="image/x-icon">
<link rel="canonical" href="http://django-rest-framework.org/api-guide/views"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
diff --git a/api-guide/viewsets.html b/api-guide/viewsets.html
index 5cd38079..f87afe9c 100644
--- a/api-guide/viewsets.html
+++ b/api-guide/viewsets.html
@@ -2,7 +2,7 @@
<html lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
- <title>Django REST framework - ViewSets</title>
+ <title>ViewSets - Django REST framework</title>
<link href="http://django-rest-framework.org/img/favicon.ico" rel="icon" type="image/x-icon">
<link rel="canonical" href="http://django-rest-framework.org/api-guide/viewsets"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
diff --git a/topics/2.2-announcement.html b/topics/2.2-announcement.html
index e76032ff..0e0584f5 100644
--- a/topics/2.2-announcement.html
+++ b/topics/2.2-announcement.html
@@ -2,7 +2,7 @@
<html lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
- <title>Django REST framework - REST framework 2.2 announcement</title>
+ <title>REST framework 2.2 announcement - Django REST framework</title>
<link href="http://django-rest-framework.org/img/favicon.ico" rel="icon" type="image/x-icon">
<link rel="canonical" href="http://django-rest-framework.org/topics/2.2-announcement"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
diff --git a/topics/2.3-announcement.html b/topics/2.3-announcement.html
index b22a136d..76d38499 100644
--- a/topics/2.3-announcement.html
+++ b/topics/2.3-announcement.html
@@ -2,7 +2,7 @@
<html lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
- <title>Django REST framework - REST framework 2.3 announcement</title>
+ <title>REST framework 2.3 announcement - Django REST framework</title>
<link href="http://django-rest-framework.org/img/favicon.ico" rel="icon" type="image/x-icon">
<link rel="canonical" href="http://django-rest-framework.org/topics/2.3-announcement"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
diff --git a/topics/ajax-csrf-cors.html b/topics/ajax-csrf-cors.html
index cf33a56e..0322d233 100644
--- a/topics/ajax-csrf-cors.html
+++ b/topics/ajax-csrf-cors.html
@@ -2,7 +2,7 @@
<html lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
- <title>Django REST framework - Working with AJAX, CSRF & CORS</title>
+ <title>Working with AJAX, CSRF & CORS - Django REST framework</title>
<link href="http://django-rest-framework.org/img/favicon.ico" rel="icon" type="image/x-icon">
<link rel="canonical" href="http://django-rest-framework.org/topics/ajax-csrf-cors"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
diff --git a/topics/browsable-api.html b/topics/browsable-api.html
index ba58eec0..2d86354d 100644
--- a/topics/browsable-api.html
+++ b/topics/browsable-api.html
@@ -2,7 +2,7 @@
<html lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
- <title>Django REST framework - The Browsable API</title>
+ <title>The Browsable API - Django REST framework</title>
<link href="http://django-rest-framework.org/img/favicon.ico" rel="icon" type="image/x-icon">
<link rel="canonical" href="http://django-rest-framework.org/topics/browsable-api"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
diff --git a/topics/browser-enhancements.html b/topics/browser-enhancements.html
index 11b53d53..f92e2737 100644
--- a/topics/browser-enhancements.html
+++ b/topics/browser-enhancements.html
@@ -2,7 +2,7 @@
<html lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
- <title>Django REST framework - Browser enhancements</title>
+ <title>Browser enhancements - Django REST framework</title>
<link href="http://django-rest-framework.org/img/favicon.ico" rel="icon" type="image/x-icon">
<link rel="canonical" href="http://django-rest-framework.org/topics/browser-enhancements"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
diff --git a/topics/contributing.html b/topics/contributing.html
index 986ff924..9120285c 100644
--- a/topics/contributing.html
+++ b/topics/contributing.html
@@ -2,7 +2,7 @@
<html lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
- <title>Django REST framework - Contributing to REST framework</title>
+ <title>Contributing to REST framework - Django REST framework</title>
<link href="http://django-rest-framework.org/img/favicon.ico" rel="icon" type="image/x-icon">
<link rel="canonical" href="http://django-rest-framework.org/topics/contributing"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
diff --git a/topics/credits.html b/topics/credits.html
index 533de882..06a7819c 100644
--- a/topics/credits.html
+++ b/topics/credits.html
@@ -2,7 +2,7 @@
<html lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
- <title>Django REST framework - Credits</title>
+ <title>Credits - Django REST framework</title>
<link href="http://django-rest-framework.org/img/favicon.ico" rel="icon" type="image/x-icon">
<link rel="canonical" href="http://django-rest-framework.org/topics/credits"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
diff --git a/topics/documenting-your-api.html b/topics/documenting-your-api.html
index 1489fb4e..29cdca4d 100644
--- a/topics/documenting-your-api.html
+++ b/topics/documenting-your-api.html
@@ -2,7 +2,7 @@
<html lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
- <title>Django REST framework - Documenting your API</title>
+ <title>Documenting your API - Django REST framework</title>
<link href="http://django-rest-framework.org/img/favicon.ico" rel="icon" type="image/x-icon">
<link rel="canonical" href="http://django-rest-framework.org/topics/documenting-your-api"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
diff --git a/topics/release-notes.html b/topics/release-notes.html
index 2630aaa0..36cc5752 100644
--- a/topics/release-notes.html
+++ b/topics/release-notes.html
@@ -2,7 +2,7 @@
<html lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
- <title>Django REST framework - Release Notes</title>
+ <title>Release Notes - Django REST framework</title>
<link href="http://django-rest-framework.org/img/favicon.ico" rel="icon" type="image/x-icon">
<link rel="canonical" href="http://django-rest-framework.org/topics/release-notes"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@@ -250,6 +250,7 @@
<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 unneccessary 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>
diff --git a/topics/rest-framework-2-announcement.html b/topics/rest-framework-2-announcement.html
index ebee8822..eed36c72 100644
--- a/topics/rest-framework-2-announcement.html
+++ b/topics/rest-framework-2-announcement.html
@@ -2,7 +2,7 @@
<html lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
- <title>Django REST framework - Django REST framework 2</title>
+ <title>Django REST framework 2 - Django REST framework</title>
<link href="http://django-rest-framework.org/img/favicon.ico" rel="icon" type="image/x-icon">
<link rel="canonical" href="http://django-rest-framework.org/topics/rest-framework-2-announcement"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
diff --git a/topics/rest-hypermedia-hateoas.html b/topics/rest-hypermedia-hateoas.html
index 176cfbf3..63a9921b 100644
--- a/topics/rest-hypermedia-hateoas.html
+++ b/topics/rest-hypermedia-hateoas.html
@@ -2,7 +2,7 @@
<html lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
- <title>Django REST framework - REST, Hypermedia & HATEOAS</title>
+ <title>REST, Hypermedia & HATEOAS - Django REST framework</title>
<link href="http://django-rest-framework.org/img/favicon.ico" rel="icon" type="image/x-icon">
<link rel="canonical" href="http://django-rest-framework.org/topics/rest-hypermedia-hateoas"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
diff --git a/topics/writable-nested-serializers.html b/topics/writable-nested-serializers.html
index 0a10ce99..32653db4 100644
--- a/topics/writable-nested-serializers.html
+++ b/topics/writable-nested-serializers.html
@@ -2,7 +2,7 @@
<html lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
- <title>Django REST framework - Writable nested serializers</title>
+ <title>Writable nested serializers - Django REST framework</title>
<link href="http://django-rest-framework.org/img/favicon.ico" rel="icon" type="image/x-icon">
<link rel="canonical" href="http://django-rest-framework.org/topics/writable-nested-serializers"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
diff --git a/tutorial/1-serialization.html b/tutorial/1-serialization.html
index c75116d3..76c7f818 100644
--- a/tutorial/1-serialization.html
+++ b/tutorial/1-serialization.html
@@ -2,7 +2,7 @@
<html lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
- <title>Django REST framework - Tutorial 1: Serialization</title>
+ <title>Tutorial 1: Serialization - Django REST framework</title>
<link href="http://django-rest-framework.org/img/favicon.ico" rel="icon" type="image/x-icon">
<link rel="canonical" href="http://django-rest-framework.org/tutorial/1-serialization"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@@ -431,8 +431,7 @@ def snippet_list(request):
if serializer.is_valid():
serializer.save()
return JSONResponse(serializer.data, status=201)
- else:
- return JSONResponse(serializer.errors, status=400)
+ return JSONResponse(serializer.errors, status=400)
</code></pre>
<p>Note that because we want to be able to POST to this view from clients that won't have a CSRF token we need to mark the view as <code>csrf_exempt</code>. This isn't something that you'd normally want to do, and REST framework views actually use more sensible behavior than this, but it'll do for our purposes right now. </p>
<p>We'll also need a view which corresponds to an individual snippet, and can be used to retrieve, update or delete the snippet.</p>
@@ -456,8 +455,7 @@ def snippet_detail(request, pk):
if serializer.is_valid():
serializer.save()
return JSONResponse(serializer.data)
- else:
- return JSONResponse(serializer.errors, status=400)
+ return JSONResponse(serializer.errors, status=400)
elif request.method == 'DELETE':
snippet.delete()
diff --git a/tutorial/2-requests-and-responses.html b/tutorial/2-requests-and-responses.html
index 6b5f67da..ef821cec 100644
--- a/tutorial/2-requests-and-responses.html
+++ b/tutorial/2-requests-and-responses.html
@@ -2,7 +2,7 @@
<html lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
- <title>Django REST framework - Tutorial 2: Requests and Responses</title>
+ <title>Tutorial 2: Requests and Responses - Django REST framework</title>
<link href="http://django-rest-framework.org/img/favicon.ico" rel="icon" type="image/x-icon">
<link rel="canonical" href="http://django-rest-framework.org/tutorial/2-requests-and-responses"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@@ -255,8 +255,7 @@ def snippet_list(request):
if serializer.is_valid():
serializer.save()
return Response(serializer.data, status=status.HTTP_201_CREATED)
- else:
- return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
+ return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
</code></pre>
<p>Our instance view is an improvement over the previous example. It's a little more concise, and the code now feels very similar to if we were working with the Forms API. We're also using named status codes, which makes the response meanings more obvious.</p>
<p>Here is the view for an individual snippet, in the <code>views.py</code> module.</p>
@@ -279,8 +278,7 @@ def snippet_detail(request, pk):
if serializer.is_valid():
serializer.save()
return Response(serializer.data)
- else:
- return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
+ return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
elif request.method == 'DELETE':
snippet.delete()
diff --git a/tutorial/3-class-based-views.html b/tutorial/3-class-based-views.html
index 6a5ca721..c807ad0f 100644
--- a/tutorial/3-class-based-views.html
+++ b/tutorial/3-class-based-views.html
@@ -2,7 +2,7 @@
<html lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
- <title>Django REST framework - Tutorial 3: Class Based Views</title>
+ <title>Tutorial 3: Class Based Views - Django REST framework</title>
<link href="http://django-rest-framework.org/img/favicon.ico" rel="icon" type="image/x-icon">
<link rel="canonical" href="http://django-rest-framework.org/tutorial/3-class-based-views"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
diff --git a/tutorial/4-authentication-and-permissions.html b/tutorial/4-authentication-and-permissions.html
index 6e166c08..dc1e2212 100644
--- a/tutorial/4-authentication-and-permissions.html
+++ b/tutorial/4-authentication-and-permissions.html
@@ -2,7 +2,7 @@
<html lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
- <title>Django REST framework - Tutorial 4: Authentication & Permissions</title>
+ <title>Tutorial 4: Authentication & Permissions - Django REST framework</title>
<link href="http://django-rest-framework.org/img/favicon.ico" rel="icon" type="image/x-icon">
<link rel="canonical" href="http://django-rest-framework.org/tutorial/4-authentication-and-permissions"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@@ -337,10 +337,10 @@ class IsOwnerOrReadOnly(permissions.BasePermission):
def has_object_permission(self, request, view, obj):
# Read permissions are allowed to any request,
# so we'll always allow GET, HEAD or OPTIONS requests.
- if request.method in permissions.SAFE_METHODS:
+ if request.method in permissions.SAFE_METHODS:
return True
- # Write permissions are only allowed to the owner of the snippet
+ # Write permissions are only allowed to the owner of the snippet.
return obj.owner == request.user
</code></pre>
<p>Now we can add that custom permission to our snippet instance endpoint, by editing the <code>permission_classes</code> property on the <code>SnippetDetail</code> class:</p>
diff --git a/tutorial/5-relationships-and-hyperlinked-apis.html b/tutorial/5-relationships-and-hyperlinked-apis.html
index 9222bc2d..9b0b5c82 100644
--- a/tutorial/5-relationships-and-hyperlinked-apis.html
+++ b/tutorial/5-relationships-and-hyperlinked-apis.html
@@ -2,7 +2,7 @@
<html lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
- <title>Django REST framework - Tutorial 5: Relationships & Hyperlinked APIs</title>
+ <title>Tutorial 5: Relationships & Hyperlinked APIs - Django REST framework</title>
<link href="http://django-rest-framework.org/img/favicon.ico" rel="icon" type="image/x-icon">
<link rel="canonical" href="http://django-rest-framework.org/tutorial/5-relationships-and-hyperlinked-apis"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
diff --git a/tutorial/6-viewsets-and-routers.html b/tutorial/6-viewsets-and-routers.html
index a5287a79..d178e26d 100644
--- a/tutorial/6-viewsets-and-routers.html
+++ b/tutorial/6-viewsets-and-routers.html
@@ -2,7 +2,7 @@
<html lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
- <title>Django REST framework - Tutorial 6: ViewSets & Routers</title>
+ <title>Tutorial 6: ViewSets & Routers - Django REST framework</title>
<link href="http://django-rest-framework.org/img/favicon.ico" rel="icon" type="image/x-icon">
<link rel="canonical" href="http://django-rest-framework.org/tutorial/6-viewsets-and-routers"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
diff --git a/tutorial/quickstart.html b/tutorial/quickstart.html
index 842cacb1..fda9ffdc 100644
--- a/tutorial/quickstart.html
+++ b/tutorial/quickstart.html
@@ -2,7 +2,7 @@
<html lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
- <title>Django REST framework - Quickstart</title>
+ <title>Quickstart - Django REST framework</title>
<link href="http://django-rest-framework.org/img/favicon.ico" rel="icon" type="image/x-icon">
<link rel="canonical" href="http://django-rest-framework.org/tutorial/quickstart"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">