aboutsummaryrefslogtreecommitdiffstats
path: root/docs/api-guide/authentication.md
diff options
context:
space:
mode:
authorCollin Anderson2014-09-23 17:08:38 -0400
committerCollin Anderson2014-09-23 17:10:02 -0400
commitda385c9c1f9deeeefd705154a6e6612d6d62f41b (patch)
treeeb878800eb479fdf072b8315282ec2b1fdea8ba2 /docs/api-guide/authentication.md
parent8495cd898a5d34f00858a379b54e39cd19ded215 (diff)
downloaddjango-rest-framework-da385c9c1f9deeeefd705154a6e6612d6d62f41b.tar.bz2
remove patterns and strings from urls #1898
Diffstat (limited to 'docs/api-guide/authentication.md')
-rwxr-xr-xdocs/api-guide/authentication.md7
1 files changed, 4 insertions, 3 deletions
diff --git a/docs/api-guide/authentication.md b/docs/api-guide/authentication.md
index 343466ee..0ec5bad1 100755
--- a/docs/api-guide/authentication.md
+++ b/docs/api-guide/authentication.md
@@ -190,9 +190,10 @@ If you've already created some users, you can generate tokens for all existing u
When using `TokenAuthentication`, you may want to provide a mechanism for clients to obtain a token given the username and password. REST framework provides a built-in view to provide this behavior. To use it, add the `obtain_auth_token` view to your URLconf:
- urlpatterns += patterns('',
- url(r'^api-token-auth/', 'rest_framework.authtoken.views.obtain_auth_token')
- )
+ from rest_framework.authtoken import views
+ urlpatterns += [
+ url(r'^api-token-auth/', views.obtain_auth_token)
+ ]
Note that the URL part of the pattern can be whatever you want to use.