diff options
| author | Tom Christie | 2013-01-22 09:11:38 +0000 |
|---|---|---|
| committer | Tom Christie | 2013-01-22 09:11:38 +0000 |
| commit | b7ab2aee46c718f683b19eefba1b48f233da40e4 (patch) | |
| tree | 1af09c7dbcc939c749d30adf25b14d232200f44f /docs/tutorial/5-relationships-and-hyperlinked-apis.md | |
| parent | 65b62d64ec54b528b62a1500b8f6ffe216d45c09 (diff) | |
| parent | e29ba356f054222893655901923811bd9675d4cc (diff) | |
| download | django-rest-framework-b7ab2aee46c718f683b19eefba1b48f233da40e4.tar.bz2 | |
Merge branch 'master' into unauthenticated_response
Conflicts:
docs/api-guide/authentication.md
Diffstat (limited to 'docs/tutorial/5-relationships-and-hyperlinked-apis.md')
| -rw-r--r-- | docs/tutorial/5-relationships-and-hyperlinked-apis.md | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/tutorial/5-relationships-and-hyperlinked-apis.md b/docs/tutorial/5-relationships-and-hyperlinked-apis.md index 216ca433..27898f7b 100644 --- a/docs/tutorial/5-relationships-and-hyperlinked-apis.md +++ b/docs/tutorial/5-relationships-and-hyperlinked-apis.md @@ -15,8 +15,8 @@ Right now we have endpoints for 'snippets' and 'users', but we don't have a sing @api_view(('GET',)) def api_root(request, format=None): return Response({ - 'users': reverse('user-list', request=request), - 'snippets': reverse('snippet-list', request=request) + 'users': reverse('user-list', request=request, format=format), + 'snippets': reverse('snippet-list', request=request, format=format) }) Notice that we're using REST framework's `reverse` function in order to return fully-qualified URLs. @@ -116,7 +116,7 @@ After adding all those names into our URLconf, our final `'urls.py'` file should url(r'^snippets/(?P<pk>[0-9]+)/$', views.SnippetDetail.as_view(), name='snippet-detail'), - url(r'^snippets/(?P<pk>[0-9]+)/highlight/$' + url(r'^snippets/(?P<pk>[0-9]+)/highlight/$', views.SnippetHighlight.as_view(), name='snippet-highlight'), url(r'^users/$', @@ -130,7 +130,7 @@ After adding all those names into our URLconf, our final `'urls.py'` file should # Login and logout views for the browsable API urlpatterns += patterns('', url(r'^api-auth/', include('rest_framework.urls', - namespace='rest_framework')) + namespace='rest_framework')), ) ## Adding pagination |
