GitHub 
-          
+           
             Next  
           
@@ -192,6 +192,10 @@
                      Content negotiation 
                   
                   
+                  
+                    Metadata 
+                   
+                  
                   
                     Format suffixes 
                    
diff --git a/api-guide/exceptions/index.html b/api-guide/exceptions/index.html
index 6a6551ec..a0734a14 100644
--- a/api-guide/exceptions/index.html
+++ b/api-guide/exceptions/index.html
@@ -192,6 +192,10 @@
                     
Content negotiation 
                   
                   
+                  
+                    Metadata 
+                   
+                  
                   
                     Format suffixes 
                    
diff --git a/api-guide/fields/index.html b/api-guide/fields/index.html
index 29c302cd..aedc4ea1 100644
--- a/api-guide/fields/index.html
+++ b/api-guide/fields/index.html
@@ -192,6 +192,10 @@
                     
Content negotiation 
                   
                   
+                  
+                    Metadata 
+                   
+                  
                   
                     Format suffixes 
                    
diff --git a/api-guide/filtering/index.html b/api-guide/filtering/index.html
index 185b44d3..6a55b999 100644
--- a/api-guide/filtering/index.html
+++ b/api-guide/filtering/index.html
@@ -192,6 +192,10 @@
                     
Content negotiation 
                   
                   
+                  
+                    Metadata 
+                   
+                  
                   
                     Format suffixes 
                    
diff --git a/api-guide/format-suffixes/index.html b/api-guide/format-suffixes/index.html
index facede7b..22181b1b 100644
--- a/api-guide/format-suffixes/index.html
+++ b/api-guide/format-suffixes/index.html
@@ -65,7 +65,7 @@
           
             Next  
-          
+           
              
           
@@ -192,6 +192,10 @@
                     
Content negotiation 
                   
                   
+                  
+                    Metadata 
+                   
+                  
                   
                     Format suffixes 
                    
diff --git a/api-guide/generic-views/index.html b/api-guide/generic-views/index.html
index 62b833d5..18910b4e 100644
--- a/api-guide/generic-views/index.html
+++ b/api-guide/generic-views/index.html
@@ -192,6 +192,10 @@
                     
Content negotiation 
                   
                   
+                  
+                    Metadata 
+                   
+                  
                   
                     Format suffixes 
                    
diff --git a/api-guide/metadata/index.html b/api-guide/metadata/index.html
new file mode 100644
index 00000000..909bdcf4
--- /dev/null
+++ b/api-guide/metadata/index.html
@@ -0,0 +1,531 @@
+
+
+
+
+  
+  
+  
Metadata - Django REST framework 
+  
+  
+  
+  
+  
+
+  
+  
+  
+  
+  
+
+  
+  
+
+  
+
+  
+
+
+
+  
+
+        
+
+    
+      
+
+        
+        
+
+        
+
+          
+
+          
+            
+              
+                
+                  metadata.py 
+                 
+              
+            
+
+            
+
Note : This is the documentation for the version 3.0  of REST framework. Documentation for version 2.4  is also available.
+
+
+
+[The OPTIONS] method allows a client to determine the options and/or requirements associated with a resource, or the capabilities of a server, without implying a resource action or initiating a resource retrieval.
+— RFC7231, Section 4.3.7. 
+ 
+
REST framework includes a configurable mechanism for determining how your API should respond to OPTIONS requests. This allows you to return API schema or other resource information.
+
There are not currently any widely adopted conventions for exactly what style of response should be returned for HTTP OPTIONS requests, so we provide an ad-hoc style that returns some useful information.
+
Here's an example response that demonstrates the information that is returned by default.
+
HTTP 200 OK
+Allow: GET, POST, HEAD, OPTIONS
+Content-Type: application/json
+
+{
+    "name": "To Do List",
+    "description": "List existing 'To Do' items, or create a new item.",
+    "renders": [
+        "application/json",
+        "text/html"
+    ],
+    "parses": [
+        "application/json",
+        "application/x-www-form-urlencoded",
+        "multipart/form-data"
+    ],
+    "actions": {
+        "POST": {
+            "note": {
+                "type": "string",
+                "required": false,
+                "read_only": false,
+                "label": "title",
+                "max_length": 100
+            }
+        }
+    }
+}
+
+
+
You can set the metadata class globally using the 'DEFAULT_METADATA_CLASS' settings key:
+
REST_FRAMEWORK = {
+    'DEFAULT_METADATA_CLASS': 'rest_framework.metadata.SimpleMetadata'
+}
+
+
Or you can set the metadata class individually for a view:
+
class APIRoot(APIView):
+    metadata_class = APIRootMetadata
+
+    def get(self, request, format=None):
+        return Response({
+            ...
+        })
+
+
The REST framework package only includes a single metadata class implementation, named SimpleMetadata. If you want to use an alternative style you'll need to implement a custom metadata class.
+
Creating schema endpoints 
+
If you have specific requirements for creating schema endpoints that are accessed with regular GET requests, you might consider re-using the metadata API for doing so.
+
For example, the following additional route could be used on a viewset to provide a linkable schema endpoint.
+
@list_route(methods=['GET'])
+def schema(self, request):
+    meta = self.metadata_class()
+    data = meta.determine_metadata(request, self)
+    return Response(data)
+
+
There are a couple of reasons that you might choose to take this approach, including that OPTIONS responses are not cacheable .
+
+
+
If you want to provide a custom metadata class you should override BaseMetadata and implement the determine_metadata(self, request, view) method.
+
Useful things that you might want to do could include returning schema information, using a format such as JSON schema , or returning debug information to admin users.
+
Example 
+
The following class could be used to limit the information that is returned to OPTIONS requests.
+
class MinimalMetadata(BaseMetadata):
+    """
+    Don't include field and other information for `OPTIONS` requests.
+    Just return the name and description.
+    """
+    def determine_metadata(self, request, view):
+        return {
+            'name': view.get_view_name(),
+            'description': view.get_view_description()
+        }
+
+
+          
+          
+        
+        
+      
+      
+    
+    
+    
+  
+  
+
+  
+
+  
+  
+  
+  
+  
+  
+
+  
+
+
+
\ No newline at end of file
diff --git a/api-guide/pagination/index.html b/api-guide/pagination/index.html
index 11ef3d27..5e8f2a82 100644
--- a/api-guide/pagination/index.html
+++ b/api-guide/pagination/index.html
@@ -192,6 +192,10 @@
                     
Content negotiation 
                   
                   
+                  
+                    Metadata 
+                   
+                  
                   
                     Format suffixes 
                    
diff --git a/api-guide/parsers/index.html b/api-guide/parsers/index.html
index 8e362b95..116b63da 100644
--- a/api-guide/parsers/index.html
+++ b/api-guide/parsers/index.html
@@ -192,6 +192,10 @@
                     
Content negotiation 
                   
                   
+                  
+                    Metadata 
+                   
+                  
                   
                     Format suffixes 
                    
diff --git a/api-guide/permissions/index.html b/api-guide/permissions/index.html
index 45efddf9..7b6f889c 100644
--- a/api-guide/permissions/index.html
+++ b/api-guide/permissions/index.html
@@ -192,6 +192,10 @@
                     
Content negotiation 
                   
                   
+                  
+                    Metadata 
+                   
+                  
                   
                     Format suffixes 
                    
diff --git a/api-guide/relations/index.html b/api-guide/relations/index.html
index 239eec48..85378cc5 100644
--- a/api-guide/relations/index.html
+++ b/api-guide/relations/index.html
@@ -192,6 +192,10 @@
                     
Content negotiation 
                   
                   
+                  
+                    Metadata 
+                   
+                  
                   
                     Format suffixes 
                    
diff --git a/api-guide/renderers/index.html b/api-guide/renderers/index.html
index 7c9ae852..58d6a3cc 100644
--- a/api-guide/renderers/index.html
+++ b/api-guide/renderers/index.html
@@ -192,6 +192,10 @@
                     
Content negotiation 
                   
                   
+                  
+                    Metadata 
+                   
+                  
                   
                     Format suffixes 
                    
diff --git a/api-guide/requests/index.html b/api-guide/requests/index.html
index 88833ed5..4cc5fd3d 100644
--- a/api-guide/requests/index.html
+++ b/api-guide/requests/index.html
@@ -192,6 +192,10 @@
                     
Content negotiation 
                   
                   
+                  
+                    Metadata 
+                   
+                  
                   
                     Format suffixes 
                    
diff --git a/api-guide/responses/index.html b/api-guide/responses/index.html
index 8ca4cfc0..43b75ade 100644
--- a/api-guide/responses/index.html
+++ b/api-guide/responses/index.html
@@ -192,6 +192,10 @@
                     
Content negotiation 
                   
                   
+                  
+                    Metadata 
+                   
+                  
                   
                     Format suffixes 
                    
diff --git a/api-guide/reverse/index.html b/api-guide/reverse/index.html
index f15c35d4..b716060d 100644
--- a/api-guide/reverse/index.html
+++ b/api-guide/reverse/index.html
@@ -192,6 +192,10 @@
                     
Content negotiation 
                   
                   
+                  
+                    Metadata 
+                   
+                  
                   
                     Format suffixes 
                    
diff --git a/api-guide/routers/index.html b/api-guide/routers/index.html
index bc95fe9d..32022b86 100644
--- a/api-guide/routers/index.html
+++ b/api-guide/routers/index.html
@@ -192,6 +192,10 @@
                     
Content negotiation 
                   
                   
+                  
+                    Metadata 
+                   
+                  
                   
                     Format suffixes 
                    
diff --git a/api-guide/serializers/index.html b/api-guide/serializers/index.html
index 13bc661d..64d6c8b9 100644
--- a/api-guide/serializers/index.html
+++ b/api-guide/serializers/index.html
@@ -192,6 +192,10 @@
                     
Content negotiation 
                   
                   
+                  
+                    Metadata 
+                   
+                  
                   
                     Format suffixes 
                    
diff --git a/api-guide/settings/index.html b/api-guide/settings/index.html
index 94050822..f3062be6 100644
--- a/api-guide/settings/index.html
+++ b/api-guide/settings/index.html
@@ -192,6 +192,10 @@
                     
Content negotiation 
                   
                   
+                  
+                    Metadata 
+                   
+                  
                   
                     Format suffixes 
                    
diff --git a/api-guide/status-codes/index.html b/api-guide/status-codes/index.html
index e2138d5e..2e503c0a 100644
--- a/api-guide/status-codes/index.html
+++ b/api-guide/status-codes/index.html
@@ -192,6 +192,10 @@
                     
Content negotiation 
                   
                   
+                  
+                    Metadata 
+                   
+                  
                   
                     Format suffixes 
                    
diff --git a/api-guide/testing/index.html b/api-guide/testing/index.html
index f3b6d005..650fc53e 100644
--- a/api-guide/testing/index.html
+++ b/api-guide/testing/index.html
@@ -192,6 +192,10 @@
                     
Content negotiation 
                   
                   
+                  
+                    Metadata 
+                   
+                  
                   
                     Format suffixes 
                    
diff --git a/api-guide/throttling/index.html b/api-guide/throttling/index.html
index 5b8c6df0..7db58e4c 100644
--- a/api-guide/throttling/index.html
+++ b/api-guide/throttling/index.html
@@ -192,6 +192,10 @@
                     
Content negotiation 
                   
                   
+                  
+                    Metadata 
+                   
+                  
                   
                     Format suffixes 
                    
diff --git a/api-guide/validators/index.html b/api-guide/validators/index.html
index 5ae6f03b..525cea8a 100644
--- a/api-guide/validators/index.html
+++ b/api-guide/validators/index.html
@@ -192,6 +192,10 @@
                     
Content negotiation 
                   
                   
+                  
+                    Metadata 
+                   
+                  
                   
                     Format suffixes 
                    
diff --git a/api-guide/views/index.html b/api-guide/views/index.html
index 231854d9..f07a4921 100644
--- a/api-guide/views/index.html
+++ b/api-guide/views/index.html
@@ -192,6 +192,10 @@
                     
Content negotiation 
                   
                   
+                  
+                    Metadata 
+                   
+                  
                   
                     Format suffixes 
                    
diff --git a/api-guide/viewsets/index.html b/api-guide/viewsets/index.html
index a0d4251e..d8cd2526 100644
--- a/api-guide/viewsets/index.html
+++ b/api-guide/viewsets/index.html
@@ -192,6 +192,10 @@
                     
Content negotiation 
                   
                   
+                  
+                    Metadata 
+                   
+                  
                   
                     Format suffixes 
                    
diff --git a/index.html b/index.html
index 59b81d21..b3c40b31 100644
--- a/index.html
+++ b/index.html
@@ -192,6 +192,10 @@
                     
Content negotiation 
                   
                   
+                  
+                    Metadata 
+                   
+                  
                   
                     Format suffixes 
                    
@@ -609,6 +613,7 @@ urlpatterns = [
 
Filtering Pagination Content negotiation 
+
Metadata Format suffixes Returning URLs Exceptions 
diff --git a/topics/2.2-announcement/index.html b/topics/2.2-announcement/index.html
index d25fb362..2a19330b 100644
--- a/topics/2.2-announcement/index.html
+++ b/topics/2.2-announcement/index.html
@@ -192,6 +192,10 @@
                     
Content negotiation 
                   
                   
+                  
+                    Metadata 
+                   
+                  
                   
                     Format suffixes 
                    
diff --git a/topics/2.3-announcement/index.html b/topics/2.3-announcement/index.html
index 12dc5ba1..eb6b8728 100644
--- a/topics/2.3-announcement/index.html
+++ b/topics/2.3-announcement/index.html
@@ -192,6 +192,10 @@
                     
Content negotiation 
                   
                   
+                  
+                    Metadata 
+                   
+                  
                   
                     Format suffixes 
                    
diff --git a/topics/2.4-announcement/index.html b/topics/2.4-announcement/index.html
index fa96619a..2ea710fe 100644
--- a/topics/2.4-announcement/index.html
+++ b/topics/2.4-announcement/index.html
@@ -192,6 +192,10 @@
                     
Content negotiation 
                   
                   
+                  
+                    Metadata 
+                   
+                  
                   
                     Format suffixes 
                    
diff --git a/topics/3.0-announcement/index.html b/topics/3.0-announcement/index.html
index 83dab0a8..96e68826 100644
--- a/topics/3.0-announcement/index.html
+++ b/topics/3.0-announcement/index.html
@@ -192,6 +192,10 @@
                     
Content negotiation 
                   
                   
+                  
+                    Metadata 
+                   
+                  
                   
                     Format suffixes 
                    
diff --git a/topics/ajax-csrf-cors/index.html b/topics/ajax-csrf-cors/index.html
index 0e22734f..64fa3d8d 100644
--- a/topics/ajax-csrf-cors/index.html
+++ b/topics/ajax-csrf-cors/index.html
@@ -192,6 +192,10 @@
                     
Content negotiation 
                   
                   
+                  
+                    Metadata 
+                   
+                  
                   
                     Format suffixes 
                    
diff --git a/topics/browsable-api/index.html b/topics/browsable-api/index.html
index f82c984d..bd4a1992 100644
--- a/topics/browsable-api/index.html
+++ b/topics/browsable-api/index.html
@@ -192,6 +192,10 @@
                     
Content negotiation 
                   
                   
+                  
+                    Metadata 
+                   
+                  
                   
                     Format suffixes 
                    
diff --git a/topics/browser-enhancements/index.html b/topics/browser-enhancements/index.html
index 30c36d72..1a949705 100644
--- a/topics/browser-enhancements/index.html
+++ b/topics/browser-enhancements/index.html
@@ -192,6 +192,10 @@
                     
Content negotiation 
                   
                   
+                  
+                    Metadata 
+                   
+                  
                   
                     Format suffixes 
                    
diff --git a/topics/contributing/index.html b/topics/contributing/index.html
index 62d0ff39..0a28159d 100644
--- a/topics/contributing/index.html
+++ b/topics/contributing/index.html
@@ -192,6 +192,10 @@
                     
Content negotiation 
                   
                   
+                  
+                    Metadata 
+                   
+                  
                   
                     Format suffixes 
                    
diff --git a/topics/credits/index.html b/topics/credits/index.html
index c20448dd..54575998 100644
--- a/topics/credits/index.html
+++ b/topics/credits/index.html
@@ -192,6 +192,10 @@
                     
Content negotiation 
                   
                   
+                  
+                    Metadata 
+                   
+                  
                   
                     Format suffixes 
                    
diff --git a/topics/documenting-your-api/index.html b/topics/documenting-your-api/index.html
index 25c6210c..c40302fc 100644
--- a/topics/documenting-your-api/index.html
+++ b/topics/documenting-your-api/index.html
@@ -192,6 +192,10 @@
                     
Content negotiation 
                   
                   
+                  
+                    Metadata 
+                   
+                  
                   
                     Format suffixes 
                    
diff --git a/topics/kickstarter-announcement/index.html b/topics/kickstarter-announcement/index.html
index f8bc71e0..717fdb07 100644
--- a/topics/kickstarter-announcement/index.html
+++ b/topics/kickstarter-announcement/index.html
@@ -192,6 +192,10 @@
                     
Content negotiation 
                   
                   
+                  
+                    Metadata 
+                   
+                  
                   
                     Format suffixes 
                    
diff --git a/topics/project-management/index.html b/topics/project-management/index.html
index 036e23a0..e1e7d756 100644
--- a/topics/project-management/index.html
+++ b/topics/project-management/index.html
@@ -192,6 +192,10 @@
                     
Content negotiation 
                   
                   
+                  
+                    Metadata 
+                   
+                  
                   
                     Format suffixes 
                    
diff --git a/topics/release-notes/index.html b/topics/release-notes/index.html
index a8d74ed8..fb25f224 100644
--- a/topics/release-notes/index.html
+++ b/topics/release-notes/index.html
@@ -192,6 +192,10 @@
                     
Content negotiation 
                   
                   
+                  
+                    Metadata 
+                   
+                  
                   
                     Format suffixes 
                    
diff --git a/topics/rest-framework-2-announcement/index.html b/topics/rest-framework-2-announcement/index.html
index 7047aa7c..18935f20 100644
--- a/topics/rest-framework-2-announcement/index.html
+++ b/topics/rest-framework-2-announcement/index.html
@@ -192,6 +192,10 @@
                     
Content negotiation 
                   
                   
+                  
+                    Metadata 
+                   
+                  
                   
                     Format suffixes 
                    
diff --git a/topics/rest-hypermedia-hateoas/index.html b/topics/rest-hypermedia-hateoas/index.html
index c5171cc0..30e6c2b6 100644
--- a/topics/rest-hypermedia-hateoas/index.html
+++ b/topics/rest-hypermedia-hateoas/index.html
@@ -192,6 +192,10 @@
                     
Content negotiation 
                   
                   
+                  
+                    Metadata 
+                   
+                  
                   
                     Format suffixes 
                    
diff --git a/topics/third-party-resources/index.html b/topics/third-party-resources/index.html
index db4aa07f..0f9e1a9c 100644
--- a/topics/third-party-resources/index.html
+++ b/topics/third-party-resources/index.html
@@ -192,6 +192,10 @@
                     
Content negotiation 
                   
                   
+                  
+                    Metadata 
+                   
+                  
                   
                     Format suffixes 
                    
diff --git a/tutorial/1-serialization/index.html b/tutorial/1-serialization/index.html
index 7cb478bd..a0e975d0 100644
--- a/tutorial/1-serialization/index.html
+++ b/tutorial/1-serialization/index.html
@@ -192,6 +192,10 @@
                     
Content negotiation 
                   
                   
+                  
+                    Metadata 
+                   
+                  
                   
                     Format suffixes 
                    
diff --git a/tutorial/2-requests-and-responses/index.html b/tutorial/2-requests-and-responses/index.html
index f117a9d3..0f4980a7 100644
--- a/tutorial/2-requests-and-responses/index.html
+++ b/tutorial/2-requests-and-responses/index.html
@@ -192,6 +192,10 @@
                     
Content negotiation 
                   
                   
+                  
+                    Metadata 
+                   
+                  
                   
                     Format suffixes 
                    
diff --git a/tutorial/3-class-based-views/index.html b/tutorial/3-class-based-views/index.html
index 6533945d..8d3886c9 100644
--- a/tutorial/3-class-based-views/index.html
+++ b/tutorial/3-class-based-views/index.html
@@ -192,6 +192,10 @@
                     
Content negotiation 
                   
                   
+                  
+                    Metadata 
+                   
+                  
                   
                     Format suffixes 
                    
diff --git a/tutorial/4-authentication-and-permissions/index.html b/tutorial/4-authentication-and-permissions/index.html
index 21e181c5..c05e6cee 100644
--- a/tutorial/4-authentication-and-permissions/index.html
+++ b/tutorial/4-authentication-and-permissions/index.html
@@ -192,6 +192,10 @@
                     
Content negotiation 
                   
                   
+                  
+                    Metadata 
+                   
+                  
                   
                     Format suffixes 
                    
diff --git a/tutorial/5-relationships-and-hyperlinked-apis/index.html b/tutorial/5-relationships-and-hyperlinked-apis/index.html
index e552c6e4..0d82b190 100644
--- a/tutorial/5-relationships-and-hyperlinked-apis/index.html
+++ b/tutorial/5-relationships-and-hyperlinked-apis/index.html
@@ -192,6 +192,10 @@
                     
Content negotiation 
                   
                   
+                  
+                    Metadata 
+                   
+                  
                   
                     Format suffixes 
                    
diff --git a/tutorial/6-viewsets-and-routers/index.html b/tutorial/6-viewsets-and-routers/index.html
index 03839e8d..4babe707 100644
--- a/tutorial/6-viewsets-and-routers/index.html
+++ b/tutorial/6-viewsets-and-routers/index.html
@@ -192,6 +192,10 @@
                     
Content negotiation 
                   
                   
+                  
+                    Metadata 
+                   
+                  
                   
                     Format suffixes 
                    
diff --git a/tutorial/quickstart/index.html b/tutorial/quickstart/index.html
index 0c593f47..80e36829 100644
--- a/tutorial/quickstart/index.html
+++ b/tutorial/quickstart/index.html
@@ -192,6 +192,10 @@
                     
Content negotiation 
                   
                   
+                  
+                    Metadata 
+                   
+                  
                   
                     Format suffixes 
                    
-- 
cgit v1.2.3