diff options
| author | Rob Romano | 2012-11-13 16:49:13 -0800 | 
|---|---|---|
| committer | Rob Romano | 2012-11-14 12:51:00 -0800 | 
| commit | 321ba156ca45da8a4b3328c4aec6a9235f32e5f8 (patch) | |
| tree | 51bdbb438943c052cc4c7ef702e4b78cb721498a /docs/api-guide/authentication.md | |
| parent | eb20b5663e68ce01453eeb855922874001f42d0f (diff) | |
| download | django-rest-framework-321ba156ca45da8a4b3328c4aec6a9235f32e5f8.tar.bz2 | |
Renamed AuthTokenView to ObtainAuthToken, added obtain_auth_token var, updated tests & docs. Left authtoken.urls in place as example.
Diffstat (limited to 'docs/api-guide/authentication.md')
| -rw-r--r-- | docs/api-guide/authentication.md | 11 | 
1 files changed, 4 insertions, 7 deletions
| diff --git a/docs/api-guide/authentication.md b/docs/api-guide/authentication.md index a55059a8..a30bd22c 100644 --- a/docs/api-guide/authentication.md +++ b/docs/api-guide/authentication.md @@ -114,18 +114,15 @@ If you've already created some User`'s, you can run a script like this.  When using TokenAuthentication, it may be useful to add a login view for clients to retrieve the token.  -REST framework provides a built-in login view. To use it, add a pattern to include the token login view for clients as follows: +REST framework provides a built-in login view for clients to retrieve the token called `rest_framework.authtoken.obtain_auth_token`. To use it, add a pattern to include the token login view for clients as follows:      urlpatterns += patterns('', -        url(r'^api-token-auth/', include('rest_framework.authtoken.urls', -                                         namespace='rest_framework')) +        url(r'^api-token-auth/', 'rest_framework.authtoken.obtain_auth_token')      ) -The `r'^api-token-auth/'` part of pattern can actually be whatever URL you want to use.  The only restriction is that the included urls must use the `'rest_framework'` namespace.   +The `r'^api-token-auth/'` part of pattern can actually be whatever URL you want to use. The authtoken login view will render a JSON response when a valid `username` and `password` fields are POST'ed to the view using forms or JSON: -The authtoken login view will render a JSON response when a valid `username` and `password` fields are POST'ed to the view using forms or JSON: - -	 { 'token' : '9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b' } +    { 'token' : '9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b' }  ## OAuthAuthentication | 
