blob: a3419da60fb6538aef225646e01adb70a2ff127c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
"""
Login view for token authentication.
Add this to your root URLconf if you're using token authentication
your API requires authentication.
You should make sure your authentication settings include
`TokenAuthentication`.
urlpatterns = patterns('',
...
url(r'^auth-token/', 'rest_framework.authtoken.obtain_auth_token')
)
"""
from django.conf.urls.defaults import patterns, url
urlpatterns = patterns('rest_framework.authtoken.views',
url(r'^login/$', 'rest_framework.authtoken.views.obtain_auth_token', name='token_login'),
)
|