diff options
Diffstat (limited to 'docs/tutorial/5-relationships-and-hyperlinked-apis.md')
| -rw-r--r-- | docs/tutorial/5-relationships-and-hyperlinked-apis.md | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/docs/tutorial/5-relationships-and-hyperlinked-apis.md b/docs/tutorial/5-relationships-and-hyperlinked-apis.md index 9c61fe3d..36473ce9 100644 --- a/docs/tutorial/5-relationships-and-hyperlinked-apis.md +++ b/docs/tutorial/5-relationships-and-hyperlinked-apis.md @@ -108,8 +108,8 @@ If we're going to have a hyperlinked API, we need to make sure we name our URL p After adding all those names into our URLconf, our final `snippets/urls.py` file should look something like this: # API endpoints - urlpatterns = format_suffix_patterns(patterns('snippets.views', - url(r'^$', 'api_root'), + urlpatterns = format_suffix_patterns([ + url(r'^$', views.api_root), url(r'^snippets/$', views.SnippetList.as_view(), name='snippet-list'), @@ -125,13 +125,13 @@ After adding all those names into our URLconf, our final `snippets/urls.py` file url(r'^users/(?P<pk>[0-9]+)/$', views.UserDetail.as_view(), name='user-detail') - )) + ]) # Login and logout views for the browsable API - urlpatterns += patterns('', + urlpatterns += [ url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')), - ) + ] ## Adding pagination |
