[英]how to check whether a user is logged in in django?
我知道 request.user.is_authenticated() 但我创建了一个自定义用户(模型)并为其创建了登录页面,现在我们如何知道用户是否已登录?
在用户登录后,在 views.py 中重定向到调用视图的 url
@login_required()
def login_success(request):
并呈现欢迎信息
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.