aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorRob Romano2012-11-13 16:49:13 -0800
committerRob Romano2012-11-13 16:49:13 -0800
commit4fd590f96f77eae433f1d5de281ed95f5a003745 (patch)
tree4653a1ef225955cbedac12a9ef240f4466230166 /docs
parentd3ee5080a0ff3894050442146083f9d4a2327c8f (diff)
downloaddjango-rest-framework-4fd590f96f77eae433f1d5de281ed95f5a003745.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')
-rw-r--r--docs/api-guide/authentication.md14
-rw-r--r--docs/topics/credits.md2
-rw-r--r--docs/topics/release-notes.md1
3 files changed, 7 insertions, 10 deletions
diff --git a/docs/api-guide/authentication.md b/docs/api-guide/authentication.md
index 50d8c054..18620f49 100644
--- a/docs/api-guide/authentication.md
+++ b/docs/api-guide/authentication.md
@@ -97,21 +97,15 @@ If successfully authenticated, `TokenAuthentication` provides the following cred
**Note:** If you use `TokenAuthentication` in production you must ensure that your API is only available over `https` only.
-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 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' }
+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:
+ { 'token' : '9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b' }
## OAuthAuthentication
diff --git a/docs/topics/credits.md b/docs/topics/credits.md
index 22d08df7..f378a521 100644
--- a/docs/topics/credits.md
+++ b/docs/topics/credits.md
@@ -59,6 +59,7 @@ The following people have helped make REST framework great.
* Toni Michel - [tonimichel]
* Ben Konrath - [benkonrath]
* Marc Aymerich - [glic3rinu]
+* Rob Romano - [robromano]
Many thanks to everyone who's contributed to the project.
@@ -153,3 +154,4 @@ To contact the author directly:
[tonimichel]: https://github.com/tonimichel
[benkonrath]: https://github.com/benkonrath
[glic3rinu]: https://github.com/glic3rinu
+[robromano]: https://github.com/robromano
diff --git a/docs/topics/release-notes.md b/docs/topics/release-notes.md
index 35e8a8b3..daacc76f 100644
--- a/docs/topics/release-notes.md
+++ b/docs/topics/release-notes.md
@@ -7,6 +7,7 @@
## Master
* Support for `read_only_fields` on `ModelSerializer` classes.
+* Add convenience login view to get tokens when using `TokenAuthentication`
## 2.1.2