aboutsummaryrefslogtreecommitdiffstats
path: root/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'index.html')
-rw-r--r--index.html744
1 files changed, 494 insertions, 250 deletions
diff --git a/index.html b/index.html
index 14599717..ecaa4d8c 100644
--- a/index.html
+++ b/index.html
@@ -1,65 +1,74 @@
<!DOCTYPE html>
<html lang="en">
-<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <meta charset="utf-8">
- <title>Django REST framework - Web APIs for Django</title>
- <link href="http://www.django-rest-framework.org/img/favicon.ico" rel="icon" type="image/x-icon">
- <link rel="canonical" href="http://www.django-rest-framework.org"/>
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta name="description" content="Django, API, REST, Django REST framework">
- <meta name="author" content="Tom Christie">
-
- <!-- Le styles -->
- <link href="http://www.django-rest-framework.org/css/prettify.css" rel="stylesheet">
- <link href="http://www.django-rest-framework.org/css/bootstrap.css" rel="stylesheet">
- <link href="http://www.django-rest-framework.org/css/bootstrap-responsive.css" rel="stylesheet">
- <link href="http://www.django-rest-framework.org/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="index-page">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <meta charset="utf-8">
+ <title>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/" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="description" content="Django, API, REST, Home">
+ <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="index-page">
<div class="wrapper">
- <div class="navbar navbar-inverse navbar-fixed-top">
+ <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 " href="tutorial/quickstart">Next <i class="icon-arrow-right icon-white"></i></a>
- <a class="repo-link btn btn-inverse btn-small disabled" href="#"><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="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="tutorial/quickstart/">
+ Next <i class="icon-arrow-right icon-white"></i>
+ </a>
+ <a class="repo-link btn btn-inverse btn-small disabled" rel="next" >
+ <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>
@@ -67,81 +76,218 @@ a.fusion-poweredby {
</a>
<a class="brand" href="http://www.django-rest-framework.org">Django REST framework</a>
<div class="nav-collapse collapse">
- <ul class="nav">
- <li><a href="http://www.django-rest-framework.org">Home</a></li>
+
+ <!-- Main navigation -->
+ <ul class="nav navbar-nav">
+ <li class="active"><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="http://www.django-rest-framework.org/tutorial/quickstart">Quickstart</a></li>
- <li><a href="http://www.django-rest-framework.org/tutorial/1-serialization">1 - Serialization</a></li>
- <li><a href="http://www.django-rest-framework.org/tutorial/2-requests-and-responses">2 - Requests and responses</a></li>
- <li><a href="http://www.django-rest-framework.org/tutorial/3-class-based-views">3 - Class based views</a></li>
- <li><a href="http://www.django-rest-framework.org/tutorial/4-authentication-and-permissions">4 - Authentication and permissions</a></li>
- <li><a href="http://www.django-rest-framework.org/tutorial/5-relationships-and-hyperlinked-apis">5 - Relationships and hyperlinked APIs</a></li>
- <li><a href="http://www.django-rest-framework.org/tutorial/6-viewsets-and-routers">6 - Viewsets and routers</a></li>
+
+ <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="http://www.django-rest-framework.org/api-guide/requests">Requests</a></li>
- <li><a href="http://www.django-rest-framework.org/api-guide/responses">Responses</a></li>
- <li><a href="http://www.django-rest-framework.org/api-guide/views">Views</a></li>
- <li><a href="http://www.django-rest-framework.org/api-guide/generic-views">Generic views</a></li>
- <li><a href="http://www.django-rest-framework.org/api-guide/viewsets">Viewsets</a></li>
- <li><a href="http://www.django-rest-framework.org/api-guide/routers">Routers</a></li>
- <li><a href="http://www.django-rest-framework.org/api-guide/parsers">Parsers</a></li>
- <li><a href="http://www.django-rest-framework.org/api-guide/renderers">Renderers</a></li>
- <li><a href="http://www.django-rest-framework.org/api-guide/serializers">Serializers</a></li>
- <li><a href="http://www.django-rest-framework.org/api-guide/fields">Serializer fields</a></li>
- <li><a href="http://www.django-rest-framework.org/api-guide/relations">Serializer relations</a></li>
- <!--<li><a href="http://www.django-rest-framework.org/api-guide/validators">Validators</a></li>-->
- <li><a href="http://www.django-rest-framework.org/api-guide/authentication">Authentication</a></li>
- <li><a href="http://www.django-rest-framework.org/api-guide/permissions">Permissions</a></li>
- <li><a href="http://www.django-rest-framework.org/api-guide/throttling">Throttling</a></li>
- <li><a href="http://www.django-rest-framework.org/api-guide/filtering">Filtering</a></li>
- <li><a href="http://www.django-rest-framework.org/api-guide/pagination">Pagination</a></li>
- <li><a href="http://www.django-rest-framework.org/api-guide/content-negotiation">Content negotiation</a></li>
- <li><a href="http://www.django-rest-framework.org/api-guide/format-suffixes">Format suffixes</a></li>
- <li><a href="http://www.django-rest-framework.org/api-guide/reverse">Returning URLs</a></li>
- <li><a href="http://www.django-rest-framework.org/api-guide/exceptions">Exceptions</a></li>
- <li><a href="http://www.django-rest-framework.org/api-guide/status-codes">Status codes</a></li>
- <li><a href="http://www.django-rest-framework.org/api-guide/testing">Testing</a></li>
- <li><a href="http://www.django-rest-framework.org/api-guide/settings">Settings</a></li>
+
+ <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/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">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Topics <b class="caret"></b></a>
<ul class="dropdown-menu">
- <li><a href="http://www.django-rest-framework.org/topics/documenting-your-api">Documenting your API</a></li>
- <li><a href="http://www.django-rest-framework.org/topics/ajax-csrf-cors">AJAX, CSRF & CORS</a></li>
- <li><a href="http://www.django-rest-framework.org/topics/browser-enhancements">Browser enhancements</a></li>
- <li><a href="http://www.django-rest-framework.org/topics/browsable-api">The Browsable API</a></li>
- <li><a href="http://www.django-rest-framework.org/topics/rest-hypermedia-hateoas">REST, Hypermedia & HATEOAS</a></li>
- <li><a href="http://www.django-rest-framework.org/topics/third-party-resources">Third Party Resources</a></li>
- <li><a href="http://www.django-rest-framework.org/topics/contributing">Contributing to REST framework</a></li>
- <li><a href="http://www.django-rest-framework.org/topics/rest-framework-2-announcement">2.0 Announcement</a></li>
- <li><a href="http://www.django-rest-framework.org/topics/2.2-announcement">2.2 Announcement</a></li>
- <li><a href="http://www.django-rest-framework.org/topics/2.3-announcement">2.3 Announcement</a></li>
- <li><a href="http://www.django-rest-framework.org/topics/2.4-announcement">2.4 Announcement</a></li>
- <li><a href="http://www.django-rest-framework.org/topics/kickstarter-announcement">Kickstarter Announcement</a></li>
- <li><a href="http://www.django-rest-framework.org/topics/release-notes">Release Notes</a></li>
- <li><a href="http://www.django-rest-framework.org/topics/credits">Credits</a></li>
- </ul>
- </li>
- </ul>
- <ul class="nav pull-right">
- <!-- TODO
- <li class="dropdown">
- <a href="#" class="dropdown-toggle" data-toggle="dropdown">Version: 2.0.0 <b class="caret"></b></a>
- <ul class="dropdown-menu">
- <li><a href="#">Trunk</a></li>
- <li><a href="#">2.0.0</a></li>
+
+ <li >
+ <a href="topics/documenting-your-api/">Documenting your API</a>
+ </li>
+
+ <li >
+ <a href="topics/ajax-csrf-cors/">AJAX, CSRF & CORS</a>
+ </li>
+
+ <li >
+ <a href="topics/browser-enhancements/">Browser enhancements</a>
+ </li>
+
+ <li >
+ <a href="topics/browsable-api/">The Browsable API</a>
+ </li>
+
+ <li >
+ <a href="topics/rest-hypermedia-hateoas/">REST, Hypermedia & HATEOAS</a>
+ </li>
+
+ <li >
+ <a href="topics/third-party-resources/">Third Party Resources</a>
+ </li>
+
+ <li >
+ <a href="topics/contributing/">Contributing to REST framework</a>
+ </li>
+
+ <li >
+ <a href="topics/rest-framework-2-announcement/">2.0 Announcement</a>
+ </li>
+
+ <li >
+ <a href="topics/2.2-announcement/">2.2 Announcement</a>
+ </li>
+
+ <li >
+ <a href="topics/2.3-announcement/">2.3 Announcement</a>
+ </li>
+
+ <li >
+ <a href="topics/2.4-announcement/">2.4 Announcement</a>
+ </li>
+
+ <li >
+ <a href="topics/kickstarter-announcement/">Kickstarter Announcement</a>
+ </li>
+
+ <li >
+ <a href="topics/release-notes/">Release Notes</a>
+ </li>
+
+ <li >
+ <a href="topics/credits/">Credits</a>
+ </li>
+
</ul>
</li>
- -->
+
+
</ul>
- </div><!--/.nav-collapse -->
+
+ </div>
+ <!--/.nav-collapse -->
+
</div>
</div>
</div>
@@ -149,32 +295,34 @@ a.fusion-poweredby {
<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>
+ <!-- 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">
@@ -187,29 +335,118 @@ a.fusion-poweredby {
-->
<div id="table-of-contents">
<ul class="nav nav-list side-nav well sidebar-nav-fixed">
- <li class="main"><a href="#django-rest-framework">Django REST framework</a></li>
-<li><a href="#requirements">Requirements</a></li>
-<li><a href="#installation">Installation</a></li>
-<li><a href="#example">Example</a></li>
-<li><a href="#quickstart">Quickstart</a></li>
-<li><a href="#tutorial">Tutorial</a></li>
-<li><a href="#api-guide">API Guide</a></li>
-<li><a href="#topics">Topics</a></li>
-<li><a href="#development">Development</a></li>
-<li><a href="#support">Support</a></li>
-<li><a href="#security">Security</a></li>
-<li><a href="#license">License</a></li>
-
- <div class="promo">
- <hr/>
- <script type="text/javascript" src="//cdn.fusionads.net/fusion.js?zoneid=1332&serve=C6SDP2Y&placement=djangorestframework" id="_fusionads_js"></script>
- </div>
-</ul>
+
+
+ <li class="main">
+ <a href="#">Django REST framework</a>
+ </li>
+
+
+
+
+ <li class="">
+ <a href="#requirements">Requirements</a>
+ </li>
+
+
+
+
+
+ <li class="">
+ <a href="#installation">Installation</a>
+ </li>
+
+
+
+
+
+ <li class="">
+ <a href="#example">Example</a>
+ </li>
+
+
+
+
+
+ <li class="">
+ <a href="#quickstart">Quickstart</a>
+ </li>
+
+
+
+
+
+ <li class="">
+ <a href="#tutorial">Tutorial</a>
+ </li>
+
+
+
+
+
+ <li class="">
+ <a href="#api-guide">API Guide</a>
+ </li>
+
+
+
+
+
+ <li class="">
+ <a href="#topics">Topics</a>
+ </li>
+
+
+
+
+
+ <li class="">
+ <a href="#development">Development</a>
+ </li>
+
+
+
+
+
+ <li class="">
+ <a href="#support">Support</a>
+ </li>
+
+
+
+
+
+ <li class="">
+ <a href="#security">Security</a>
+ </li>
+
+
+
+
+
+ <li class="">
+ <a href="#license">License</a>
+ </li>
+
+
+
+
+
+
+ <div class="promo">
+ <hr/>
+ <script type="text/javascript" src="//cdn.fusionads.net/fusion.js?zoneid=1332&serve=C6SDP2Y&placement=djangorestframework" id="_fusionads_js"></script>
+ </div>
+
+
+ </ul>
</div>
</div>
<div id="main-content" class="span9">
+
+
<p class="badges" height=20px>
<iframe src="http://ghbtns.com/github-btn.html?user=tomchristie&amp;repo=django-rest-framework&amp;type=watch&amp;count=true" class="github-star-button" allowtransparency="true" frameborder="0" scrolling="0" width="110px" height="20px"></iframe>
@@ -232,25 +469,21 @@ a.fusion-poweredby {
clip: rect(0,0,0,0);
border: 0;">Django REST Framework</h1>
-<img alt="Django REST Framework" title="Logo by Jake 'Sid' Smith" src="img/logo.png" width="600px" style="display: block; margin: 0 auto 0 auto">
+<img alt="Django REST Framework" title="Logo by Jake 'Sid' Smith" src="./img/logo.png" width="600px" style="display: block; margin: 0 auto 0 auto">
</p>
-<!--
-# Django REST framework
--->
-
<p>Django REST framework is a powerful and flexible toolkit that makes it easy to build Web APIs.</p>
<p>Some reasons you might want to use REST framework:</p>
<ul>
<li>The <a href="http://restframework.herokuapp.com/">Web browseable API</a> is a huge usability win for your developers.</li>
-<li><a href="api-guide/authentication">Authentication policies</a> including <a href="api-guide/authentication#oauthauthentication">OAuth1a</a> and <a href="api-guide/authentication#oauth2authentication">OAuth2</a> out of the box.</li>
-<li><a href="api-guide/serializers">Serialization</a> that supports both <a href="api-guide/serializers#modelserializer">ORM</a> and <a href="api-guide/serializers#serializers">non-ORM</a> data sources.</li>
-<li>Customizable all the way down - just use <a href="api-guide/views#function-based-views">regular function-based views</a> if you don't need the <a href="api-guide/generic-views">more</a> <a href="api-guide/viewsets">powerful</a> <a href="api-guide/routers">features</a>.</li>
-<li><a href=".">Extensive documentation</a>, and <a href="https://groups.google.com/forum/?fromgroups#!forum/django-rest-framework">great community support</a>.</li>
+<li><a href="api-guide/authentication/">Authentication policies</a> including <a href="./api-guide/authentication#oauthauthentication">OAuth1a</a> and <a href="./api-guide/authentication#oauth2authentication">OAuth2</a> out of the box.</li>
+<li><a href="api-guide/serializers/">Serialization</a> that supports both <a href="./api-guide/serializers#modelserializer">ORM</a> and <a href="./api-guide/serializers#serializers">non-ORM</a> data sources.</li>
+<li>Customizable all the way down - just use <a href="./api-guide/views#function-based-views">regular function-based views</a> if you don't need the <a href="api-guide/generic-views/">more</a> <a href="api-guide/viewsets/">powerful</a> <a href="api-guide/routers/">features</a>.</li>
+<li><a href="./.">Extensive documentation</a>, and <a href="https://groups.google.com/forum/?fromgroups#!forum/django-rest-framework">great community support</a>.</li>
<li>Used and trusted by large companies such as <a href="http://www.mozilla.org/en-US/about/">Mozilla</a> and <a href="https://www.eventbrite.co.uk/about/">Eventbrite</a>.</li>
</ul>
<hr />
-<p><img alt="Screenshot" src="img/quickstart.png" /></p>
+<p><img alt="Screenshot" src="./img/quickstart.png" /></p>
<p><strong>Above</strong>: <em>Screenshot from the browsable API</em></p>
<h2 id="requirements">Requirements</h2>
<p>REST framework requires the following:</p>
@@ -271,21 +504,21 @@ a.fusion-poweredby {
<p><strong>Note</strong>: The <code>oauth2</code> Python package is badly misnamed, and actually provides OAuth 1.0a support. Also note that packages required for both OAuth 1.0a, and OAuth 2.0 are not yet Python 3 compatible.</p>
<h2 id="installation">Installation</h2>
<p>Install using <code>pip</code>, including any optional packages you want...</p>
-<pre class="prettyprint lang-py"><code>pip install djangorestframework
+<pre><code>pip install djangorestframework
pip install markdown # Markdown support for the browsable API.
pip install django-filter # Filtering support
</code></pre>
<p>...or clone the project from github.</p>
-<pre class="prettyprint lang-py"><code>git clone git@github.com:tomchristie/django-rest-framework.git
+<pre><code>git clone git@github.com:tomchristie/django-rest-framework.git
</code></pre>
<p>Add <code>'rest_framework'</code> to your <code>INSTALLED_APPS</code> setting.</p>
-<pre class="prettyprint lang-py"><code>INSTALLED_APPS = (
+<pre><code>INSTALLED_APPS = (
...
'rest_framework',
)
</code></pre>
<p>If you're intending to use the browsable API you'll probably also want to add REST framework's login and logout views. Add the following to your root <code>urls.py</code> file.</p>
-<pre class="prettyprint lang-py"><code>urlpatterns = [
+<pre><code>urlpatterns = [
...
url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework'))
]
@@ -295,7 +528,7 @@ pip install django-filter # Filtering support
<p>Let's take a look at a quick example of using REST framework to build a simple model-backed API.</p>
<p>We'll create a read-write API for accessing information on the users of our project.</p>
<p>Any global settings for a REST framework API are kept in a single configuration dictionary named <code>REST_FRAMEWORK</code>. Start off by adding the following to your <code>settings.py</code> module:</p>
-<pre class="prettyprint lang-py"><code>REST_FRAMEWORK = {
+<pre><code>REST_FRAMEWORK = {
# Use Django's standard `django.contrib.auth` permissions,
# or allow read-only access for unauthenticated users.
'DEFAULT_PERMISSION_CLASSES': [
@@ -306,7 +539,7 @@ pip install django-filter # Filtering support
<p>Don't forget to make sure you've also added <code>rest_framework</code> to your <code>INSTALLED_APPS</code>.</p>
<p>We're ready to create our API now.
Here's our project's root <code>urls.py</code> module:</p>
-<pre class="prettyprint lang-py"><code>from django.conf.urls import url, include
+<pre><code>from django.conf.urls import url, include
from django.contrib.auth.models import User
from rest_framework import routers, serializers, viewsets
@@ -334,65 +567,66 @@ urlpatterns = [
</code></pre>
<p>You can now open the API in your browser at <a href="http://127.0.0.1:8000/">http://127.0.0.1:8000/</a>, and view your new 'users' API. If you use the login control in the top right corner you'll also be able to add, create and delete users from the system.</p>
<h2 id="quickstart">Quickstart</h2>
-<p>Can't wait to get started? The <a href="tutorial/quickstart">quickstart guide</a> is the fastest way to get up and running, and building APIs with REST framework.</p>
+<p>Can't wait to get started? The <a href="tutorial/quickstart/">quickstart guide</a> is the fastest way to get up and running, and building APIs with REST framework.</p>
<h2 id="tutorial">Tutorial</h2>
<p>The tutorial will walk you through the building blocks that make up REST framework. It'll take a little while to get through, but it'll give you a comprehensive understanding of how everything fits together, and is highly recommended reading.</p>
<ul>
-<li><a href="tutorial/1-serialization">1 - Serialization</a></li>
-<li><a href="tutorial/2-requests-and-responses">2 - Requests &amp; 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 &amp; permissions</a></li>
-<li><a href="tutorial/5-relationships-and-hyperlinked-apis">5 - Relationships &amp; hyperlinked APIs</a></li>
-<li><a href="tutorial/6-viewsets-and-routers">6 - Viewsets &amp; routers</a></li>
+<li><a href="tutorial/1-serialization/">1 - Serialization</a></li>
+<li><a href="tutorial/2-requests-and-responses/">2 - Requests &amp; 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 &amp; permissions</a></li>
+<li><a href="tutorial/5-relationships-and-hyperlinked-apis/">5 - Relationships &amp; hyperlinked APIs</a></li>
+<li><a href="tutorial/6-viewsets-and-routers/">6 - Viewsets &amp; routers</a></li>
</ul>
<p>There is a live example API of the finished tutorial API for testing purposes, <a href="http://restframework.herokuapp.com/">available here</a>.</p>
<h2 id="api-guide">API Guide</h2>
<p>The API guide is your complete reference manual to all the functionality provided by REST framework.</p>
<ul>
-<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> <!--* <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/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>
+<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>[Validators][validators]</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/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>
<h2 id="topics">Topics</h2>
<p>General guides to using REST framework.</p>
<ul>
-<li><a href="topics/documenting-your-api">Documenting your API</a></li>
-<li><a href="topics/ajax-csrf-cors">AJAX, CSRF &amp; CORS</a></li>
-<li><a href="topics/browser-enhancements">Browser enhancements</a></li>
-<li><a href="topics/browsable-api">The Browsable API</a></li>
-<li><a href="topics/rest-hypermedia-hateoas">REST, Hypermedia &amp; HATEOAS</a></li>
-<li><a href="topics/third-party-resources">Third Party Resources</a></li>
-<li><a href="topics/contributing">Contributing to REST framework</a></li>
-<li><a href="topics/rest-framework-2-announcement">2.0 Announcement</a></li>
-<li><a href="topics/2.2-announcement">2.2 Announcement</a></li>
-<li><a href="topics/2.3-announcement">2.3 Announcement</a></li>
-<li><a href="topics/2.4-announcement">2.4 Announcement</a></li>
-<li><a href="topics/kickstarter-announcement">Kickstarter Announcement</a></li>
-<li><a href="topics/release-notes">Release Notes</a></li>
-<li><a href="topics/credits">Credits</a></li>
+<li><a href="topics/documenting-your-api/">Documenting your API</a></li>
+<li><a href="topics/ajax-csrf-cors/">AJAX, CSRF &amp; CORS</a></li>
+<li><a href="topics/browser-enhancements/">Browser enhancements</a></li>
+<li><a href="topics/browsable-api/">The Browsable API</a></li>
+<li><a href="topics/rest-hypermedia-hateoas/">REST, Hypermedia &amp; HATEOAS</a></li>
+<li><a href="topics/third-party-resources/">Third Party Resources</a></li>
+<li><a href="topics/contributing/">Contributing to REST framework</a></li>
+<li><a href="topics/rest-framework-2-announcement/">2.0 Announcement</a></li>
+<li><a href="topics/2.2-announcement/">2.2 Announcement</a></li>
+<li><a href="topics/2.3-announcement/">2.3 Announcement</a></li>
+<li><a href="topics/2.4-announcement/">2.4 Announcement</a></li>
+<li><a href="topics/kickstarter-announcement/">Kickstarter Announcement</a></li>
+<li><a href="topics/release-notes/">Release Notes</a></li>
+<li><a href="topics/credits/">Credits</a></li>
</ul>
<h2 id="development">Development</h2>
-<p>See the <a href="topics/contributing">Contribution guidelines</a> for information on how to clone
+<p>See the <a href="topics/contributing/">Contribution guidelines</a> for information on how to clone
the repository, run the test suite and contribute changes back to REST
Framework.</p>
<h2 id="support">Support</h2>
@@ -424,42 +658,52 @@ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</p>
- </div><!--/span-->
- </div><!--/row-->
- </div><!--/.fluid-container-->
- </div><!--/.body content-->
- <div id="push"></div>
- </div><!--/.wrapper -->
+ </div>
+ <!--/span-->
+ </div>
+ <!--/row-->
+ </div>
+ <!--/.fluid-container-->
+ </div>
+ <!--/.body content-->
+ <div id="push"></div>
+ </div>
+ <!--/.wrapper -->
<footer class="span12">
- <p>Sponsored by <a href="http://dabapps.com/">DabApps</a>.</a></p>
+ <p>Sponsored by <a href="http://dabapps.com/">DabApps</a>.</a>
+ </p>
</footer>
- <!-- Le javascript
- ================================================== -->
- <!-- Placed at the end of the document so the pages load faster -->
- <script src="http://www.django-rest-framework.org/js/jquery-1.8.1-min.js"></script>
- <script src="http://www.django-rest-framework.org/js/prettify-1.0.js"></script>
- <script src="http://www.django-rest-framework.org/js/bootstrap-2.1.1-min.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();
+ <!-- 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>
+ //$('.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>
- // 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>
+</html> \ No newline at end of file