diff options
| author | Rob Romano | 2012-11-13 16:49:13 -0800 |
|---|---|---|
| committer | Rob Romano | 2012-11-13 16:49:13 -0800 |
| commit | 4fd590f96f77eae433f1d5de281ed95f5a003745 (patch) | |
| tree | 4653a1ef225955cbedac12a9ef240f4466230166 /rest_framework/authtoken/urls.py | |
| parent | d3ee5080a0ff3894050442146083f9d4a2327c8f (diff) | |
| download | django-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 'rest_framework/authtoken/urls.py')
| -rw-r--r-- | rest_framework/authtoken/urls.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/rest_framework/authtoken/urls.py b/rest_framework/authtoken/urls.py index 87872136..a3419da6 100644 --- a/rest_framework/authtoken/urls.py +++ b/rest_framework/authtoken/urls.py @@ -1,20 +1,20 @@ """ -Login and logout views for token authentication. +Login view for token authentication. -Add these to your root URLconf if you're using token authentication +Add this to your root URLconf if you're using token authentication your API requires authentication. -The urls must be namespaced as 'rest_framework', and you should make sure -your authentication settings include `TokenAuthentication`. +You should make sure your authentication settings include +`TokenAuthentication`. urlpatterns = patterns('', ... - url(r'^auth-token', include('rest_framework.authtoken.urls', namespace='rest_framework')) + url(r'^auth-token/', 'rest_framework.authtoken.obtain_auth_token') ) """ + from django.conf.urls.defaults import patterns, url -from rest_framework.authtoken.views import AuthTokenView urlpatterns = patterns('rest_framework.authtoken.views', - url(r'^login/$', AuthTokenView.as_view(), name='token_login'), + url(r'^login/$', 'rest_framework.authtoken.views.obtain_auth_token', name='token_login'), ) |
