基本代码结构 url.py: from django.conf.urls import url, include from app import views urlpatterns = [ url(r'^test/', views.TestView.as_view()), ] views.py: from rest_framework.views import APIView from rest_framework.response import Response from rest_frame…