router.register(r'sections', views.SectionsViewSet)
from rest_framework import serializers
from course.models import Sections
class SectionsSerializer(serializers.ModelSerializer):
class Meta:
model = Sections
fields = '__all__'
from rest_framework import viewsets
from course.models import *
from course.serializers import *
class SectionsViewSet(viewsets.ModelViewSet):
queryset = Sections.objects.all()
serializer_class = SectionsSerializer
from django.contrib import admin
from . import models
admin.site.register(models.Sections)
http://192.168.56.100:8888/course/sections/