from rest_framework import generics

from .models import Category
from .serializers import CategorySerializer


class CategoryList(generics.ListAPIView):
    queryset = Category.objects.all()
    serializer_class = CategorySerializer

@@ -207,28 +207,185 @@
 _class = CategorySerializer%0A
+%0A%0Aclass CategoryDetail(generics.RetrieveAPIView):%0A    queryset = Category.objects.all()%0A    serializer_class = CategorySerializer%0A%0A    lookup_field = 'slug'%0A

add category detail view