Skip to content

Conversation

@Bhuwan-web
Copy link
Contributor

Basename key missing in the tutorial

+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)

Description

Modern versions are supposed to show error on setting up routers for viewset without the basename which I found missing on the tutorial page which frustrates many of new learning developers like me. Hope the contribution will be valued

# 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)
```
Copy link
Contributor

@lovelydinosaur lovelydinosaur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@lovelydinosaur lovelydinosaur merged commit c26ec5a into encode:master Feb 1, 2022
sigvef pushed a commit to sigvef/django-rest-framework that referenced this pull request Dec 3, 2022
# 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)
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants