Skip to content

Commit 012b570

Browse files
committed
ref(router): use the built in router of Django
DefaultRouter does all the actions we need and the @action and @link is not used anywhere in our code base. @list_route and @detail_route exist if needed http://www.django-rest-framework.org/api-guide/routers/#defaultrouter
1 parent f09b55e commit 012b570

2 files changed

Lines changed: 4 additions & 51 deletions

File tree

rootfs/api/routers.py

Lines changed: 0 additions & 48 deletions
This file was deleted.

rootfs/api/urls.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55

66
from django.conf import settings
77
from django.conf.urls import include, url
8-
9-
from api import routers, views
108
from rest_framework.authtoken.views import obtain_auth_token as views_obtain_auth_token
9+
from rest_framework.routers import DefaultRouter
10+
11+
from api import views
1112

1213

13-
router = routers.ApiRouter()
14+
router = DefaultRouter(trailing_slash=False)
1415

1516
# Add the generated REST URLs and login/logout endpoint
1617
urlpatterns = [

0 commit comments

Comments
 (0)