2
下面這裏是我的看法。現在,我無法實現Redis緩存。我想在我簡單的Django項目中使用Redis-Cache。我無法理解django中的實現
從django.core.cache導入緩存 類UserListView(APIView):
def get(self, request):
# userss = Cach.objects.values('cache_id', 'username', 'email')
data = Cach.objects.values('cache_id', 'username', 'email')
# cache.set('users',userss)
# data = cache.get('users')
return Response(data)