aboutsummaryrefslogtreecommitdiffstats
path: root/api-guide
diff options
context:
space:
mode:
authorTom Christie2013-12-23 12:37:56 +0000
committerTom Christie2013-12-23 12:37:56 +0000
commit66cc2d3d5d611c57638a59932cd65c62d9b130c2 (patch)
tree9856f0c766c51f45e753dd8a6c01844879c5c0b4 /api-guide
parente6fd79fd88067d830886f9c463d5b9e5c13d7ce3 (diff)
downloaddjango-rest-framework-66cc2d3d5d611c57638a59932cd65c62d9b130c2.tar.bz2
Switch title ordering.
Diffstat (limited to 'api-guide')
-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
23 files changed, 30 insertions, 23 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">