diff options
| author | Tom Christie | 2015-03-23 11:34:01 +0000 |
|---|---|---|
| committer | Tom Christie | 2015-03-23 11:34:01 +0000 |
| commit | 5e96a1ddf17946595a22083b035f99418dd2cbd7 (patch) | |
| tree | 6f77e244f775547635492bc9e6a2e019a54b2c2b /api-guide/versioning | |
| parent | 09d51ea4e256ed99421dc52cd6b4626e7172b667 (diff) | |
| download | django-rest-framework-5e96a1ddf17946595a22083b035f99418dd2cbd7.tar.bz2 | |
Update documentation
Diffstat (limited to 'api-guide/versioning')
| -rw-r--r-- | api-guide/versioning/index.html | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/api-guide/versioning/index.html b/api-guide/versioning/index.html index 8a29d0ea..b42aecc7 100644 --- a/api-guide/versioning/index.html +++ b/api-guide/versioning/index.html @@ -370,7 +370,7 @@ </li> <li> - <a href="#urlparameterversioning">URLParameterVersioning</a> + <a href="#urlpathversioning">URLPathVersioning</a> </li> <li> @@ -436,7 +436,9 @@ </code></pre> <h4 id="reversing-urls-for-versioned-apis">Reversing URLs for versioned APIs</h4> <p>The <code>reverse</code> function included by REST framework ties in with the versioning scheme. You need to make sure to include the current <code>request</code> as a keyword argument, like so.</p> -<pre><code>reverse('bookings-list', request=request) +<pre><code>from rest_framework.reverse import reverse + +reverse('bookings-list', request=request) </code></pre> <p>The above function will apply any URL transformations appropriate to the request version. For example:</p> <ul> @@ -490,7 +492,7 @@ Accept: application/json; version=1.0 Host: example.com Accept: application/vnd.megacorp.bookings+json; version=1.0 </code></pre> -<h2 id="urlparameterversioning">URLParameterVersioning</h2> +<h2 id="urlpathversioning">URLPathVersioning</h2> <p>This scheme requires the client to specify the version as part of the URL path.</p> <pre><code>GET /v1/bookings/ HTTP/1.1 Host: example.com |
