mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-11 12:17:24 +03:00
Merge pull request #578 from Wackerbarth/tutorial
Format extensions have already been introduced.
This commit is contained in:
commit
cae9a334ce
|
@ -15,8 +15,8 @@ Right now we have endpoints for 'snippets' and 'users', but we don't have a sing
|
||||||
@api_view(('GET',))
|
@api_view(('GET',))
|
||||||
def api_root(request, format=None):
|
def api_root(request, format=None):
|
||||||
return Response({
|
return Response({
|
||||||
'users': reverse('user-list', request=request),
|
'users': reverse('user-list', request=request, format=format),
|
||||||
'snippets': reverse('snippet-list', request=request)
|
'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.
|
Notice that we're using REST framework's `reverse` function in order to return fully-qualified URLs.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user