Skip to content

Commit 5521eac

Browse files
chrisguoxrpkilby
authored andcommitted
Update docs imports (encode#7030)
1 parent ab40b80 commit 5521eac

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

docs/api-guide/caching.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,16 @@ other cache decorators such as [`cache_page`][page] and
1717
[`vary_on_cookie`][cookie].
1818

1919
```python
20+
from django.utils.decorators import method_decorator
21+
from django.views.decorators.cache import cache_page
22+
from django.views.decorators.vary import vary_on_cookie
23+
2024
from rest_framework.response import Response
2125
from rest_framework.views import APIView
2226
from rest_framework import viewsets
2327

24-
class UserViewSet(viewsets.Viewset):
28+
29+
class UserViewSet(viewsets.ViewSet):
2530

2631
# Cache requested url for each user for 2 hours
2732
@method_decorator(cache_page(60*60*2))
@@ -32,6 +37,7 @@ class UserViewSet(viewsets.Viewset):
3237
}
3338
return Response(content)
3439

40+
3541
class PostView(APIView):
3642

3743
# Cache page for the requested url

0 commit comments

Comments
 (0)