From 152b2ae6afc12cba9f03bc9b136bbf6780deda0e Mon Sep 17 00:00:00 2001 From: Johannes Christ Date: Sun, 23 Sep 2018 15:09:28 +0200 Subject: Add viewsets and URLs for the Tag API. --- api/urls.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'api/urls.py') diff --git a/api/urls.py b/api/urls.py index f4ed641c..e69f1c73 100644 --- a/api/urls.py +++ b/api/urls.py @@ -4,7 +4,8 @@ from rest_framework.routers import SimpleRouter from .views import HealthcheckView from .viewsets import ( DocumentationLinkViewSet, MemberViewSet, - OffTopicChannelNameViewSet, SnakeNameViewSet + OffTopicChannelNameViewSet, SnakeNameViewSet, + TagViewSet ) @@ -28,7 +29,10 @@ bot_router.register( SnakeNameViewSet, base_name='snakename' ) - +bot_router.register( + 'tags', + TagViewSet, +) app_name = 'api' urlpatterns = ( -- cgit v1.2.3 From d285c580e9bfb8afe2225d7b8c2db822071f2d15 Mon Sep 17 00:00:00 2001 From: Johannes Christ Date: Sun, 23 Sep 2018 15:15:55 +0200 Subject: Add API root view documentation. --- api/urls.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'api/urls.py') diff --git a/api/urls.py b/api/urls.py index e69f1c73..1648471c 100644 --- a/api/urls.py +++ b/api/urls.py @@ -1,5 +1,5 @@ from django.urls import include, path -from rest_framework.routers import SimpleRouter +from rest_framework.routers import DefaultRouter from .views import HealthcheckView from .viewsets import ( @@ -9,8 +9,8 @@ from .viewsets import ( ) -# http://www.django-rest-framework.org/api-guide/routers/#simplerouter -bot_router = SimpleRouter(trailing_slash=False) +# http://www.django-rest-framework.org/api-guide/routers/#defaultrouter +bot_router = DefaultRouter(trailing_slash=False) bot_router.register( 'documentation-links', DocumentationLinkViewSet -- cgit v1.2.3