api.routers

REST framework URL routing classes.

class api.routers.ApiRouter(trailing_slash=True)[source]

Generate URL patterns for list, detail, and viewset-specific HTTP routes.

routes = [Route(url=u'^{prefix}/?$', mapping={u'post': u'create', u'get': u'list'}, name=u'{basename}-list', initkwargs={u'suffix': u'List'}), Route(url=u'^{prefix}/{lookup}/?$', mapping={u'put': u'update', u'delete': u'destroy', u'patch': u'partial_update', u'get': u'retrieve'}, name=u'{basename}-detail', initkwargs={u'suffix': u'Instance'}), Route(url=u'^{prefix}/{lookup}/{methodname}/?$', mapping={u'{httpmethod}': u'{methodname}'}, name=u'{basename}-{methodnamehyphen}', initkwargs={})]