I was reading through a long piece of code. And was stuck at how routers and viewsets automatically configure their URLs. For eg. the views.py file is:
class UserViewSet(viewsets.ModelViewSet):
authentication_classes = (BasicAuthentication,SessionAuthentication)
permission_classes = (IsAuthenticated,)
serializer_class = UserSerializer
queryset = User.objects.all()
The corresponding urls with router is:
router = DefaultRouter()
router.register(r'users',views.UserViewSet,basename='user')
urlpatterns = router.urls
In the above case, what will be the respective urls for the different actions in viewsets, ie list, create, retrieve, update, partial_update and destroy as mentioned in the djangorestframework documentation on viewsets: http://www.tomchristie.com/rest-framework-2-docs/api-guide/viewsets