Module Expr Str ImportFrom alias Import alias ImportFrom alias alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias Assign NameStore Call NameLoad Str ListLoad Str Str Str Str Assign NameStore Call NameLoad Str ListLoad Str Str Str Assign NameStore Call NameLoad Str ListLoad Str Str Str FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Str Str Assign NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return Call AttributeLoad NameLoad attr NameLoad decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr ListLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr TupleLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Raise Call NameLoad Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Raise Call NameLoad Str decorator_list FunctionDef arguments args NameParam defaults body If UnaryOpNot Call NameLoad NameLoad Str body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Return AttributeLoad NameLoad attr decorator_list NameLoad decorator_list ClassDef bases NameLoad body Assign NameStore ListLoad Call NameLoad keyword Str keyword Dict Str Str Str Str keyword Str keyword Dict Str Str Call NameLoad keyword Str keyword Str keyword Dict Call NameLoad keyword Str keyword Dict Str Str Str Str Str Str Str Str keyword Str keyword Dict Str Str Call NameLoad keyword Str keyword Str keyword Dict FunctionDef arguments args NameParam NameParam defaults NameLoad body Assign AttributeStore NameLoad attr BoolOpOr BoolOpAnd NameLoad Str Str Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad Str NameLoad Assert CompareIsNot NameLoad NameLoad Str Return Call AttributeLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad ListComp Call AttributeLoad AttributeLoad NameLoad attr attr comprehension NameStore AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad Assign NameStore ListLoad Assign NameStore ListLoad For NameStore Call NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Str NameLoad Assign NameStore Call NameLoad NameLoad Str NameLoad If NameLoad body If CompareIn NameLoad NameLoad body Raise Call NameLoad BinOpMod Str NameLoad Assign NameStore ListComp Call AttributeLoad NameLoad attr comprehension NameStore NameLoad If NameLoad body Expr Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad orelse Expr Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad FunctionDef arguments args NameParam NameParam defaults body Assign NameStore ListLoad For TupleStore NameStore NameStore NameLoad body Assign NameStore AttributeLoad Call NameLoad NameLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore BoolOpOr Call AttributeLoad NameLoad attr Str NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad keyword Call NameLoad AttributeLoad NameLoad attr NameLoad keyword DictComp NameLoad NameLoad comprehension NameStore NameLoad keyword Call NameLoad AttributeLoad NameLoad attr NameLoad keyword NameLoad Return NameLoad decorator_list Assign NameStore ListLoad For NameStore AttributeLoad NameLoad attr body If Call NameLoad NameLoad NameLoad body AugAssignAdd NameStore Call NameLoad NameLoad NameLoad orelse If Call NameLoad NameLoad NameLoad body AugAssignAdd NameStore Call NameLoad NameLoad NameLoad orelse Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Dict For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr body If Call NameLoad NameLoad NameLoad body Assign SubscriptStore NameLoad Index NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Str body Expr Str Assign NameStore Str Assign NameStore Call NameLoad NameLoad Str Str Assign NameStore BoolOpOr Call NameLoad NameLoad Str NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Str Str Return Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore ListLoad For TupleStore NameStore NameStore NameStore AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad For NameStore NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr If UnaryOpNot NameLoad body Continue Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad keyword NameLoad keyword AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad keyword NameLoad Return NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore Str FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad Assign NameStore AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index Num attr For TupleStore NameStore NameStore NameStore AttributeLoad NameLoad attr body Assign SubscriptStore NameLoad Index NameLoad Call AttributeLoad NameLoad attr keyword NameLoad ClassDef bases AttributeLoad NameLoad attr body Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam defaults vararg kwarg body Assign NameStore Call NameLoad Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr body If NameLoad body Assign NameStore BinOpAdd BinOpAdd NameLoad Str NameLoad TryExcept body Assign SubscriptStore NameLoad Index NameLoad Call NameLoad NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword Call AttributeLoad NameLoad attr Str NameLoad handlers ExceptHandler type NameLoad body Continue Return Call NameLoad NameLoad decorator_list decorator_list Return Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore ListLoad If AttributeLoad NameLoad attr body Assign NameStore Call NameLoad Str Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad Call NameLoad NameLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad If AttributeLoad NameLoad attr body Assign NameStore Call NameLoad NameLoad Return NameLoad decorator_list decorator_list
N/A N/A 
Routers provide a convenient and consistent way of automatically
determining the URL conf for your API.

They are used by simply instantiating a Router class, and then registering
all the required ViewSets with that router.

For example, you might have a `urls.py` that looks something like this:

    router = routers.DefaultRouter()
    router.register('users', UserViewSet, 'user')
    router.register('accounts', AccountViewSet, 'account')

    urlpatterns = router.urls
 __future__ unicode_literals N/A itertools collections OrderedDict namedtuple django.conf.urls url django.core.exceptions ImproperlyConfigured django.core.urlresolvers NoReverseMatch rest_framework views rest_framework.response Response rest_framework.reverse reverse rest_framework.urlpatterns format_suffix_patterns N/A Route N/A namedtuple Route N/A url mapping name initkwargs N/A DynamicDetailRoute N/A namedtuple DynamicDetailRoute N/A url name initkwargs N/A DynamicListRoute N/A namedtuple DynamicListRoute N/A url name initkwargs replace_methodname N/A N/A format_string methodname N/A N/A N/A 
    Partially format a format_string, swapping out any
    '{methodname}' or '{methodnamehyphen}' components.
     N/A methodnamehyphen N/A N/A methodname replace _ - N/A ret format_string N/A ret N/A N/A ret replace {methodname} methodname N/A ret N/A N/A ret replace {methodnamehyphen} methodnamehyphen N/A ret N/A flatten N/A N/A list_of_lists N/A N/A N/A 
    Takes an iterable of iterables, returns a single iterable containing all items
     N/A N/A N/A itertools chain list_of_lists N/A BaseRouter N/A object N/A __init__ N/A N/A self N/A N/A N/A N/A self registry N/A N/A register N/A N/A self prefix viewset base_name N/A None N/A N/A N/A base_name None N/A N/A base_name N/A N/A self get_default_base_name viewset N/A N/A N/A N/A self registry append N/A prefix viewset base_name N/A get_default_base_name N/A N/A self viewset N/A N/A N/A 
        If `base_name` is not specified, attempt to automatically determine
        it from the viewset.
         N/A N/A NotImplementedError get_default_base_name must be overridden N/A get_urls N/A N/A self N/A N/A N/A 
        Return a list of URL patterns, given the registered viewsets.
         N/A N/A NotImplementedError get_urls must be overridden N/A urls N/A N/A self N/A N/A N/A N/A N/A hasattr self _urls N/A N/A N/A self _urls N/A N/A self get_urls N/A N/A self _urls N/A property N/A SimpleRouter N/A BaseRouter N/A N/A routes N/A N/A Route url ^{prefix}{trailing_slash}$ mapping N/A get post list create name {basename}-list initkwargs N/A suffix List N/A DynamicListRoute url ^{prefix}/{methodname}{trailing_slash}$ name {basename}-{methodnamehyphen} initkwargs N/A N/A Route url ^{prefix}/{lookup}{trailing_slash}$ mapping N/A get put patch delete retrieve update partial_update destroy name {basename}-detail initkwargs N/A suffix Instance N/A DynamicDetailRoute url ^{prefix}/{lookup}/{methodname}{trailing_slash}$ name {basename}-{methodnamehyphen} initkwargs N/A __init__ N/A N/A self trailing_slash N/A True N/A N/A N/A self trailing_slash N/A N/A trailing_slash / N/A N/A N/A N/A super SimpleRouter self __init__ N/A get_default_base_name N/A N/A self viewset N/A N/A N/A 
        If `base_name` is not specified, attempt to automatically determine
        it from the viewset.
         N/A queryset N/A getattr viewset queryset None N/A N/A queryset None `base_name` argument not specified, and could not automatically determine the name from the viewset, as it does not have a `.queryset` attribute. N/A N/A N/A N/A N/A N/A queryset model _meta object_name lower N/A get_routes N/A N/A self viewset N/A N/A N/A 
        Augment `self.routes` with any dynamically generated routes.

        Returns a list of the Route namedtuple.
         N/A known_actions N/A flatten N/A N/A N/A N/A route mapping values N/A route N/A self routes N/A isinstance route Route N/A detail_routes N/A N/A list_routes N/A N/A methodname N/A dir viewset N/A N/A attr N/A getattr viewset methodname N/A httpmethods N/A getattr attr bind_to_methods None N/A detail N/A getattr attr detail True N/A httpmethods N/A N/A N/A methodname known_actions N/A N/A N/A ImproperlyConfigured N/A Cannot use @detail_route or @list_route decorators on method "%s" as it is an existing route methodname N/A httpmethods N/A N/A N/A method lower N/A method httpmethods N/A detail N/A N/A N/A N/A detail_routes append N/A httpmethods methodname N/A N/A N/A N/A list_routes append N/A httpmethods methodname _get_dynamic_routes N/A N/A route dynamic_routes N/A N/A N/A ret N/A N/A N/A httpmethods methodname dynamic_routes N/A N/A method_kwargs N/A N/A getattr viewset methodname kwargs N/A initkwargs N/A N/A N/A route initkwargs copy N/A N/A N/A initkwargs update method_kwargs N/A url_path N/A N/A N/A initkwargs pop url_path None methodname N/A N/A N/A ret append N/A Route url N/A replace_methodname N/A route url url_path mapping N/A httpmethod methodname N/A httpmethod httpmethods name N/A replace_methodname N/A route name url_path initkwargs initkwargs N/A ret N/A N/A ret N/A N/A route N/A self routes N/A N/A N/A isinstance route DynamicDetailRoute N/A N/A ret N/A _get_dynamic_routes route detail_routes N/A N/A N/A isinstance route DynamicListRoute N/A N/A ret N/A _get_dynamic_routes route list_routes N/A N/A N/A N/A ret append route N/A ret N/A get_method_map N/A N/A self viewset method_map N/A N/A N/A 
        Given a viewset, and a mapping of http methods to actions,
        return a new mapping which only includes any mappings that
        are actually implemented by the viewset.
         N/A bound_methods N/A N/A N/A method action N/A N/A method_map items N/A N/A N/A hasattr viewset action N/A N/A N/A bound_methods N/A method action N/A bound_methods N/A get_lookup_regex N/A N/A self viewset lookup_prefix N/A N/A N/A 
        Given a viewset, return the portion of URL regex that is used
        to match against a single instance.

        Note that lookup_prefix is not used directly inside REST rest_framework
        itself, but is required in order to nicely support nested router
        implementations, such as drf-nested-routers.

        https://github.com/alanjds/drf-nested-routers
         N/A base_regex (?P<{lookup_prefix}{lookup_url_kwarg}>{lookup_value}) N/A lookup_field N/A getattr viewset lookup_field pk N/A lookup_url_kwarg N/A N/A getattr viewset lookup_url_kwarg None lookup_field N/A lookup_value N/A getattr viewset lookup_value_regex [^/.]+ N/A N/A N/A base_regex format lookup_prefix lookup_prefix lookup_url_kwarg lookup_url_kwarg lookup_value lookup_value N/A get_urls N/A N/A self N/A N/A N/A 
        Use the registered viewsets to generate a list of URL patterns.
         N/A ret N/A N/A N/A prefix viewset basename N/A self registry N/A N/A lookup N/A N/A self get_lookup_regex viewset N/A routes N/A N/A self get_routes viewset N/A route routes N/A N/A mapping N/A N/A self get_method_map viewset N/A route mapping N/A N/A mapping N/A N/A N/A regex N/A N/A N/A route url format prefix prefix lookup lookup trailing_slash N/A self trailing_slash N/A view N/A N/A viewset as_view mapping N/A route initkwargs N/A name N/A N/A N/A route name format basename basename N/A N/A N/A ret append N/A url regex view name name N/A ret N/A N/A DefaultRouter N/A SimpleRouter N/A N/A 
    The default router extends the SimpleRouter, but also adds in a default
    API root view, and adds format suffix patterns to the URLs.
     N/A include_root_view True N/A include_format_suffixes True N/A root_view_name api-root get_api_root_view N/A N/A self N/A N/A N/A 
        Return a view to use as the API root.
         N/A api_root_dict N/A OrderedDict N/A list_name N/A N/A N/A self routes N/A 0 name N/A N/A prefix viewset basename N/A self registry N/A N/A N/A api_root_dict N/A prefix N/A N/A list_name format basename basename APIRoot N/A N/A views APIView N/A N/A _ignore_model_permissions True get N/A N/A self request N/A args kwargs N/A N/A ret N/A OrderedDict N/A namespace N/A N/A request resolver_match namespace N/A N/A key url_name N/A N/A api_root_dict items N/A N/A namespace N/A N/A url_name N/A N/A namespace : url_name N/A N/A N/A N/A ret N/A key N/A reverse url_name args args kwargs kwargs request request format N/A N/A kwargs get format None N/A N/A N/A NoReverseMatch N/A N/A N/A N/A Response ret N/A N/A N/A N/A N/A APIRoot as_view N/A get_urls N/A N/A self N/A N/A N/A 
        Generate the list of URL patterns, including a default root view
        for the API, and appending `.json` style format suffixes.
         N/A urls N/A N/A N/A self include_root_view N/A N/A root_url N/A url ^$ N/A N/A self get_api_root_view name N/A self root_view_name N/A N/A N/A urls append root_url N/A default_urls N/A N/A N/A super DefaultRouter self get_urls N/A N/A N/A urls extend default_urls N/A N/A self include_format_suffixes N/A N/A urls N/A format_suffix_patterns urls N/A urls N/A N/A