aboutsummaryrefslogtreecommitdiffstats
path: root/docs/tutorial/5-relationships-and-hyperlinked-apis.md
diff options
context:
space:
mode:
authorTom Christie2014-09-24 09:02:53 +0100
committerTom Christie2014-09-24 09:02:53 +0100
commit4ffae7c0e959e42fa2dde830ac144e94ee8aae71 (patch)
treeeb878800eb479fdf072b8315282ec2b1fdea8ba2 /docs/tutorial/5-relationships-and-hyperlinked-apis.md
parent8495cd898a5d34f00858a379b54e39cd19ded215 (diff)
parentda385c9c1f9deeeefd705154a6e6612d6d62f41b (diff)
downloaddjango-rest-framework-4ffae7c0e959e42fa2dde830ac144e94ee8aae71.tar.bz2
Merge pull request #1899 from collinanderson/urls
Remove patterns and strings from urls in tutorial.
Diffstat (limited to 'docs/tutorial/5-relationships-and-hyperlinked-apis.md')
-rw-r--r--docs/tutorial/5-relationships-and-hyperlinked-apis.md10
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