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
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -173,9 +173,9 @@ The `curl` command line tool may be useful for testing token authenticated APIs.
173
173
174
174
---
175
175
176
-
####Generating Tokens
176
+
### Generating Tokens
177
177
178
-
#####By using signals
178
+
#### By using signals
179
179
180
180
If you want every user to have an automatically generated Token, you can simply catch the User's `post_save` signal.
181
181
@@ -199,7 +199,7 @@ If you've already created some users, you can generate tokens for all existing u
199
199
for user in User.objects.all():
200
200
Token.objects.get_or_create(user=user)
201
201
202
-
#####By exposing an api endpoint
202
+
#### By exposing an api endpoint
203
203
204
204
When using `TokenAuthentication`, you may want to provide a mechanism for clients to obtain a token given the username and password. REST framework provides a built-in view to provide this behaviour. To use it, add the `obtain_auth_token` view to your URLconf:
205
205
@@ -248,7 +248,7 @@ And in your `urls.py`:
248
248
]
249
249
250
250
251
-
#####With Django admin
251
+
#### With Django admin
252
252
253
253
It is also possible to create Tokens manually through the admin interface. In case you are using a large user base, we recommend that you monkey patch the `TokenAdmin` class customize it to your needs, more specifically by declaring the `user` field as `raw_field`.
254
254
@@ -369,7 +369,7 @@ The following third-party packages are also available.
369
369
370
370
The [Django OAuth Toolkit][django-oauth-toolkit] package provides OAuth 2.0 support and works with Python 3.4+. The package is maintained by [jazzband][jazzband] and uses the excellent [OAuthLib][oauthlib]. The package is well documented, and well supported and is currently our **recommended package for OAuth 2.0 support**.
0 commit comments