i try to cache ModelViewSet:
my view is :
class CommentsViewSet(ModelViewSet):
queryset = CommentsModel.objects.all()
serializer_class = CommentsALLSerializer
http_method_names = ['get']
permission_classes = (AllowAny,)
i try this but not work:
@method_decorator(cache_page(60*60))
def dispatch(self, *args, **kwargs):
return super().dispatch(*args, **kwargs)
how to deal with it ?
--
You received this message because you are subscribed to the Google Groups
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-rest-framework/605c8643-53eb-456a-afba-e102ca44dd97%40googlegroups.com.