You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/api-guide/routers.md
+32Lines changed: 32 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,6 +49,38 @@ This means you'll need to explicitly set the `base_name` argument when registeri
49
49
50
50
---
51
51
52
+
### Using `include` with routers
53
+
54
+
The `.urls` attribute on a router instance is simply a standard list of URL patterns. There are a number of different styles for how you can include these URLs.
55
+
56
+
For example, you can append `router.urls` to a list of existing views…
If using namespacing with hyperlinked serializers you'll also need to ensure that any `view_name` parameters on the serializers correctly reflect the namespace. In the example above you'd need to include a parameter such as `view_name='api:user-detail'` for serializer fields hyperlinked to the user detail view.
83
+
52
84
### Extra link and actions
53
85
54
86
Any methods on the viewset decorated with `@detail_route` or `@list_route` will also be routed.
0 commit comments