路由: a. url(r'^(?P<version>[v1|v2]+)/v1/$',views.ViewView.as_view()) url(r'^(?P<version>[v1|v2]+)/v1.(?P<format>w+)$',views.ViewView.as_view()) b. url(r'^(?P<version>[v1|v2]+)/v1/(?P<pk>d+)/$',views.ViewView.as_view({'get':'list',})) c. 自动生成路由 from rest_framework import routers routers = routers.DefaultRouter() routers.register(r'user', views.UserInfoView) routers.register(r'group', views.GroupView) urlpatterns = { url(r'^(?P<version>[v1|v2]+)/', include(routers.urls)), }