diff options
author | 2018-08-15 21:46:56 +0200 | |
---|---|---|
committer | 2018-08-15 21:46:56 +0200 | |
commit | fc38b383ea99df7f0c26bd94d04445c88527d566 (patch) | |
tree | 6c2111a4766067437aeab3e2c1eaf0d4e1efaa3f /api/urls.py | |
parent | Use `reverse` from `django-hosts`. (diff) |
Use viewsets and the `rest_framework` router.
Diffstat (limited to 'api/urls.py')
-rw-r--r-- | api/urls.py | 11 |
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 |