简体   繁体   English

django rest-auth login token 使用方法

[英]django rest-auth login token use approach

I am using django rest-auth for handling user registration and login.我正在使用 django rest-auth 来处理用户注册和登录。 whenever I try to login, it gives me token.每当我尝试登录时,它都会给我令牌。 so my question is now how to make use of that token to log in user to the home page.所以我现在的问题是如何使用该令牌将用户登录到主页。 enter image description here在此处输入图像描述

what I want is to make use of that token to login the user in to home page.我想要的是利用该令牌将用户登录到主页。 thank you谢谢你

You have to pass the token along with every request (in the request headers) to show that the user is logged.您必须将令牌与每个请求(在请求标头中)一起传递以显示用户已登录。

In Postman, go to headers and add the following under Authorization (make sure it's checked too).在 Postman, go 到标题中,并在授权下添加以下内容(确保也已检查)。

Token (without the brackets).令牌(不带括号)。

图片

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM