From a0528fdaf523d81e65c6cf1cb7760086ffc3ed4d Mon Sep 17 00:00:00 2001 From: Carlton Gibson Date: Thu, 22 Feb 2018 16:49:50 +0100 Subject: [PATCH] Adjust wording --- docs/api-guide/routers.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/api-guide/routers.md b/docs/api-guide/routers.md index 3a4f8dd43..3e0dcd3b2 100644 --- a/docs/api-guide/routers.md +++ b/docs/api-guide/routers.md @@ -73,7 +73,7 @@ Alternatively you can use Django's `include` function, like so… ] To include the router URL patterns with an application namespace pass a -`(router.urls, app_name)` 2-tuple to `include`. +`(router.urls, 'app_name')` 2-tuple to `include`. For example: @@ -82,9 +82,8 @@ For example: url(r'^api/', include((router.urls, 'app_name'))), ] -(`include` also allows an optional `namespace` parameter to also create an _instance namespace_. -This defaults to `None` and will be set to `app_name` if not provided. -See Django's [URL namespaces docs][url-namespace-docs] for more details.) +(You may additionally pass an optional `namespace` parameter to `include` to also +create an _instance namespace_. See Django's [URL namespaces docs][url-namespace-docs] for more details.) 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='app_name:user-detail'` for serializer fields hyperlinked to the user detail view.