46👍
✅
You are setting the header to Authorization: Token
when it really should just be Authorization
. The header is actually just Authorization
, but the value is Token [token_string]
, where [token_string]
is the authorization token that you have obtained.
3👍
- [Django]-Why there are two process when i run python manage.py runserver
- [Django]-How to get the username of the logged-in user in Django?
- [Django]-What does error mean? : "Forbidden (Referer checking failed – no Referer.):"
0👍
- [Django]-Django admin hangs (until timeout error) for a specific model when trying to edit/create
- [Django]-Django Class Based View for both Create and Update
- [Django]-Cannot import name _uuid_generate_random in heroku django
0👍
After Specifying Authorization and Token value try to add the token in an environment so that every time you don’t have to copy the token value.
- [Django]-How do I change the range of the x-axis with datetime?
- [Django]-Web application monitoring best practices
- [Django]-How to 'bulk update' with Django?
0👍
After get access token from http://127.0.0.1:8000/accounts/login/
such this :
{
"email": "user@example.com",
"tokens": {
"refresh": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaCIsImV4cCI6MTY2NjI2NTAxMSwiaWF0IjoxNjY2MTc4NjExLCJqdGkiOiJjZWM3MzJmNDZkMGE0MTNjOTE3ODM5ZGYxNzRiNzMxZCIsInVzZXJfaWQiOjcwfQ.5Rd25s6msp72IHyU1BxE4ym24YIEbhyFsBdUztGXz0I",
"access": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNjY2MjY1MDExLCJpYXQiOjE2NjYxNzg2MTEsImp0aSI6IjgyOWFmZGE5MWY2ODRhNDZhMDllZGMzMmI0NmY0Mzg5IiwidXNlcl9pZCI6NzB9.TYhi0INai293ljc5zBk59Hwet-m9a1Mc1CtA56BEE_8"
},
"id": 70
}
copy content of "access" key in response, then in post man in Headers add new item by key : Authorization
and value such this:
Bearer eyJ0eXAi....
that eyJ0eXAi…. is value of access key.
then send the request.
- [Django]-Django ModelForm: What is save(commit=False) used for?
- [Django]-Django – Render the <label> of a single form field
- [Django]-What is "load url from future" in Django
Source:stackexchange.com