You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/api-guide/authentication.md
+1-36
Original file line number
Diff line number
Diff line change
@@ -128,11 +128,10 @@ To use the `TokenAuthentication` scheme you'll need to [configure the authentica
128
128
129
129
---
130
130
131
-
**Note:** Make sure to run `manage.py syncdb` after changing your settings. The `rest_framework.authtoken` app provides both Django (from v1.7) and South database migrations. See [Schema migrations](#schema-migrations) below.
131
+
**Note:** Make sure to run `manage.py migrate` after changing your settings. The `rest_framework.authtoken` app provides Django database migrations.
132
132
133
133
---
134
134
135
-
136
135
You'll also need to create tokens for your users.
137
136
138
137
from rest_framework.authtoken.models import Token
@@ -217,38 +216,6 @@ It is also possible to create Tokens manually through admin interface. In case y
217
216
TokenAdmin.raw_id_fields = ('user',)
218
217
219
218
220
-
#### Schema migrations
221
-
222
-
The `rest_framework.authtoken` app includes both Django native migrations (for Django versions >1.7) and South migrations (for Django versions <1.7) that will create the authtoken table.
223
-
224
-
----
225
-
226
-
**Note**: From REST Framework v2.4.0 using South with Django <1.7 requires upgrading South v1.0+
227
-
228
-
----
229
-
230
-
231
-
If you're using a [custom user model][custom-user-model] you'll need to make sure that any initial migration that creates the user table runs before the authtoken table is created.
232
-
233
-
You can do so by inserting a `needed_by` attribute in your user migration:
234
-
235
-
class Migration:
236
-
237
-
needed_by = (
238
-
('authtoken', '0001_initial'),
239
-
)
240
-
241
-
def forwards(self):
242
-
...
243
-
244
-
For more details, see the [south documentation on dependencies][south-dependencies].
245
-
246
-
Also note that if you're using a `post_save` signal to create tokens, then the first time you create the database tables, you'll need to ensure any migrations are run prior to creating any superusers. For example:
247
-
248
-
python manage.py syncdb --noinput # Won't create a superuser just yet, due to `--noinput`.
249
-
python manage.py migrate
250
-
python manage.py createsuperuser
251
-
252
219
## SessionAuthentication
253
220
254
221
This authentication scheme uses Django's default session backend for authentication. Session authentication is appropriate for AJAX clients that are running in the same session context as your website.
@@ -392,8 +359,6 @@ HTTP Signature (currently a [IETF draft][http-signature-ietf-draft]) provides a
0 commit comments