Created
June 3, 2019 04:17
-
-
Save Joel-hanson/42102abff18452ad5a59cb7577f52b28 to your computer and use it in GitHub Desktop.
In this example, we are using a DefaultRouter which adds support for automatic URL routing to Django, and provides you with a simple, quick and consistent way of wiring your view logic to a set of URLs.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from rest_framework.routers import DefaultRouter | |
from .views import BookModelViewSet | |
router = DefaultRouter(trailing_slash=False) | |
router.register(r'book', BookModelViewSet, base_name='book') | |
urlpatterns = router.urls |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment