
from rest_framework import routers

# Special router for actions.
actions_router = routers.Route(url=r'^{prefix}/{methodname}{trailing_slash}$',
                               mapping={'{httpmethod}': '{methodname}'},
                               name='{basename}-{methodnamehyphen}',
                               initkwargs={})


class DefaultRouter(routers.DefaultRouter):
    routes = [
        routers.DefaultRouter.routes[0],
        actions_router,
        routers.DefaultRouter.routes[2],
        routers.DefaultRouter.routes[1]
    ]


__all__ = ["DefaultRouter"]


from rest_framework import routers


class DefaultRouter(routers.DefaultRouter):
    pass


__all__ = ["DefaultRouter"]

Remove old reimplementation of routes.
Remove old reimplementation of routes.

  
  from rest_framework import routers
  
- # Special router for actions.
- actions_router = routers.Route(url=r'^{prefix}/{methodname}{trailing_slash}$',
-                                mapping={'{httpmethod}': '{methodname}'},
-                                name='{basename}-{methodnamehyphen}',
-                                initkwargs={})
- 
  
  class DefaultRouter(routers.DefaultRouter):
+     pass
-     routes = [
-         routers.DefaultRouter.routes[0],
-         actions_router,
-         routers.DefaultRouter.routes[2],
-         routers.DefaultRouter.routes[1]
-     ]
  
  
  __all__ = ["DefaultRouter"]
  
Remove old reimplementation of routes.
## Code Before:

from rest_framework import routers

# Special router for actions.
actions_router = routers.Route(url=r'^{prefix}/{methodname}{trailing_slash}$',
                               mapping={'{httpmethod}': '{methodname}'},
                               name='{basename}-{methodnamehyphen}',
                               initkwargs={})


class DefaultRouter(routers.DefaultRouter):
    routes = [
        routers.DefaultRouter.routes[0],
        actions_router,
        routers.DefaultRouter.routes[2],
        routers.DefaultRouter.routes[1]
    ]


__all__ = ["DefaultRouter"]

## Instruction:
Remove old reimplementation of routes.
## Code After:

from rest_framework import routers


class DefaultRouter(routers.DefaultRouter):
    pass


__all__ = ["DefaultRouter"]
