aboutsummaryrefslogtreecommitdiffstats
path: root/api/urls.py
diff options
context:
space:
mode:
authorGravatar Johannes Christ <[email protected]>2018-08-15 21:46:56 +0200
committerGravatar Johannes Christ <[email protected]>2018-08-15 21:46:56 +0200
commitfc38b383ea99df7f0c26bd94d04445c88527d566 (patch)
tree6c2111a4766067437aeab3e2c1eaf0d4e1efaa3f /api/urls.py
parentUse `reverse` from `django-hosts`. (diff)
Use viewsets and the `rest_framework` router.
Diffstat (limited to 'api/urls.py')
-rw-r--r--api/urls.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/api/urls.py b/api/urls.py
new file mode 100644
index 00000000..c1fa70d5
--- /dev/null
+++ b/api/urls.py
@@ -0,0 +1,11 @@
+from rest_framework.routers import SimpleRouter
+
+from .viewsets import SnakeNameViewSet
+
+
+# http://www.django-rest-framework.org/api-guide/routers/#simplerouter
+router = SimpleRouter(trailing_slash=False)
+router.register(r'snake-names', SnakeNameViewSet)
+
+app_name = 'api'
+urlpatterns = router.urls