mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-04-25 19:43:47 +03:00
Put the needed import in one example
This commit is contained in:
parent
e34e0536b1
commit
a5506610ad
|
@ -31,6 +31,8 @@ How you vary the API behavior is up to you, but one example you might typically
|
||||||
|
|
||||||
The `reverse` function included by REST framework ties in with the versioning scheme. You need to make sure to include the current `request` as a keyword argument, like so.
|
The `reverse` function included by REST framework ties in with the versioning scheme. You need to make sure to include the current `request` as a keyword argument, like so.
|
||||||
|
|
||||||
|
from rest_framework.reverse import reverse
|
||||||
|
|
||||||
reverse('bookings-list', request=request)
|
reverse('bookings-list', request=request)
|
||||||
|
|
||||||
The above function will apply any URL transformations appropriate to the request version. For example:
|
The above function will apply any URL transformations appropriate to the request version. For example:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user