5👍
Check modheader. It allows you to set headers for your request. You can set the token authtoken there where “Name” would be “Authorization” and “Value” would be “Token “.
In my case, I was using rest_framework_JWT so, Authorization headers were like “JWT your_token”.
0👍
you can use tools like Postman
or
you can add authentication.SessionAuthentication to your authentication_classes
authentication_classes = [authentication.TokenAuthentication, authentication.SessionAuthentication]
so as long as you are logged in you can see the put patch and options request on the page.
by this method, you are not sending any Token. use it for development purposes.
- [Django]-Postgresql DROP TABLE doesn't work
- [Django]-How to decode url to path in python, django
- [Django]-Django Background Task
-1👍
- In you postman select
Post
method and in Headers of request write
Authorization
for key andToken bd8877272b3384341d063d1
for
value. Use you token generated for each user. - Or you can also enter username and password instead of token in
Headers in postman.
- [Django]-Django: Admin: changing the widget of the field in Admin
- [Django]-Django.db.utils.OperationalError: fe_sendauth: no password supplied
- [Django]-Difference between reverse() and reverse_lazy() in Django
Source:stackexchange.com