Skip to content

Commit de3d0d1

Browse files
krzysztofjeziornythibaudcolas
authored andcommitted
Update configuration.md
More details and an error fix (no ":" after `Token` in the send header).
1 parent 10308ea commit de3d0d1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

docs/advanced_topics/api/v2/configuration.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ For cases where the source image set may contain SVGs, the `ImageRenditionField`
292292

293293
### Authentication
294294

295-
To protect the access to your API, you can implement an [authentication](https://www.django-rest-framework.org/api-guide/authentication/) method provided by the Django Rest Framework, for example the [Token Authentication](https://www.django-rest-framework.org/api-guide/authentication/#tokenauthentication):
295+
To protect the access to your API, you can implement an [authentication](https://www.django-rest-framework.org/api-guide/authentication/) method provided by the Django REST Framework, for example the [Token Authentication](https://www.django-rest-framework.org/api-guide/authentication/#tokenauthentication):
296296

297297
```python
298298
# api.py
@@ -332,9 +332,11 @@ REST_FRAMEWORK = {
332332
```
333333

334334

335-
Don't forget to run the needed migrations.
335+
Don't forget to run the app's migrations.
336+
337+
Your API endpoint will be accessible only with the Authorization header containing the generated `Token exampleSecretToken123xyz`.
338+
Tokens can be generated in the Django admin under Auth Token or using the `manage.py` command `drf_create_token`.
336339

337-
Your API endpoint will be accessible only with the Authorization header containing the generated `Token: exampletoken123xyz`.
338340
Note: If you use `TokenAuthentication` in production you must ensure that your API is only available over `https`.
339341

340342
## Additional settings

0 commit comments

Comments
 (0)