diff options
| author | Xavier Ordoquy | 2015-01-28 00:06:34 +0100 |
|---|---|---|
| committer | Xavier Ordoquy | 2015-01-28 00:06:34 +0100 |
| commit | 0daf160946db4f2fed6a237136d738d954b841c0 (patch) | |
| tree | 37ccf211a304a6c754ae1e7583fb402b7aa3eaa5 /docs/api-guide/routers.md | |
| parent | cf8a09993fb2b9b3ce66a40e2d9a38c16caa6842 (diff) | |
| download | django-rest-framework-0daf160946db4f2fed6a237136d738d954b841c0.tar.bz2 | |
Fix #2476
Diffstat (limited to 'docs/api-guide/routers.md')
| -rw-r--r-- | docs/api-guide/routers.md | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/docs/api-guide/routers.md b/docs/api-guide/routers.md index 9c9bfb50..a9f911a9 100644 --- a/docs/api-guide/routers.md +++ b/docs/api-guide/routers.md @@ -60,7 +60,7 @@ For example, you can append `router.urls` to a list of existing views… router.register(r'accounts', AccountViewSet) urlpatterns = [ - url(r'^forgot-password/$', ForgotPasswordFormView.as_view(), + url(r'^forgot-password/$', ForgotPasswordFormView.as_view()), ] urlpatterns += router.urls @@ -68,15 +68,15 @@ For example, you can append `router.urls` to a list of existing views… Alternatively you can use Django's `include` function, like so… urlpatterns = [ - url(r'^forgot-password/$', ForgotPasswordFormView.as_view(), - url(r'^', include(router.urls)) + url(r'^forgot-password/$', ForgotPasswordFormView.as_view()), + url(r'^', include(router.urls)), ] Router URL patterns can also be namespaces. urlpatterns = [ - url(r'^forgot-password/$', ForgotPasswordFormView.as_view(), - url(r'^api/', include(router.urls, namespace='api')) + url(r'^forgot-password/$', ForgotPasswordFormView.as_view()), + url(r'^api/', include(router.urls, namespace='api')), ] 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. |
