Add info about TokenAuthentication schema

This commit is contained in:
Aitzol 2014-05-29 14:32:49 +02:00
parent 708b6a6c06
commit 6952b965c2

View File

@ -126,6 +126,15 @@ To use the `TokenAuthentication` scheme, include `rest_framework.authtoken` in y
'rest_framework.authtoken'
)
Also you need to enable `TokenAuthentication` from `rest_framework.authentication`in the `REST_FRAMEWORK['DEFAULT_AUTHENTICATION_CLASSES` list:
REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': (
...
'rest_framework.authentication.TokenAuthentication',
...
)}
Make sure to run `manage.py syncdb` after changing your settings. The `authtoken` database tables are managed by south (see [Schema migrations](#schema-migrations) below).
You'll also need to create tokens for your users.