魔法路由ViewSetMixin
实现方式
视图
class Test(ViewSetMixin, APIView):
def test1(self, request):
return HttpResponse('ok')
def test2(self, request):
return HttpResponse('ok')
路由
url(r'^test/', views.Test.as_view({'get': 'test1', 'post': 'test2'})),