Skip to content

Commit b0a1712

Browse files
committed
Update documentation
1 parent 987880e commit b0a1712

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

api-guide/routers/index.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -483,21 +483,21 @@ <h3 id="using-include-with-routers">Using <code>include</code> with routers</h3>
483483
router.register(r'accounts', AccountViewSet)
484484

485485
urlpatterns = [
486-
url(r'^forgot-password/$', ForgotPasswordFormView.as_view(),
486+
url(r'^forgot-password/$', ForgotPasswordFormView.as_view()),
487487
]
488488

489489
urlpatterns += router.urls
490490
</code></pre>
491491
<p>Alternatively you can use Django's <code>include</code> function, like so…</p>
492492
<pre><code>urlpatterns = [
493-
url(r'^forgot-password/$', ForgotPasswordFormView.as_view(),
494-
url(r'^', include(router.urls))
493+
url(r'^forgot-password/$', ForgotPasswordFormView.as_view()),
494+
url(r'^', include(router.urls)),
495495
]
496496
</code></pre>
497497
<p>Router URL patterns can also be namespaces.</p>
498498
<pre><code>urlpatterns = [
499-
url(r'^forgot-password/$', ForgotPasswordFormView.as_view(),
500-
url(r'^api/', include(router.urls, namespace='api'))
499+
url(r'^forgot-password/$', ForgotPasswordFormView.as_view()),
500+
url(r'^api/', include(router.urls, namespace='api')),
501501
]
502502
</code></pre>
503503
<p>If using namespacing with hyperlinked serializers you'll also need to ensure that any <code>view_name</code> parameters on the serializers correctly reflect the namespace. In the example above you'd need to include a parameter such as <code>view_name='api:user-detail'</code> for serializer fields hyperlinked to the user detail view.</p>

0 commit comments

Comments
 (0)