mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-10 19:56:59 +03:00
Update 6-viewsets-and-routers.md (#8349)
# Basename key missing in the tutorial ```diff +router.register(r'snippets', views.SnippetViewSet,basename="snippets") +router.register(r'users', views.UserViewSet,basename="users") -router.register(r'snippets', views.SnippetViewSet) -router.register(r'users', views.UserViewSet) ```
This commit is contained in:
parent
a5d741aba4
commit
c26ec5a3b8
|
@ -112,8 +112,8 @@ Here's our re-wired `snippets/urls.py` file.
|
|||
|
||||
# Create a router and register our viewsets with it.
|
||||
router = DefaultRouter()
|
||||
router.register(r'snippets', views.SnippetViewSet)
|
||||
router.register(r'users', views.UserViewSet)
|
||||
router.register(r'snippets', views.SnippetViewSet,basename="snippets")
|
||||
router.register(r'users', views.UserViewSet,basename="users")
|
||||
|
||||
# The API URLs are now determined automatically by the router.
|
||||
urlpatterns = [
|
||||
|
|
Loading…
Reference in New Issue
Block a user