简体   繁体   中英

how to check whether a user is logged in in django?

我知道 request.user.is_authenticated() 但我创建了一个自定义用户(模型)并为其创建了登录页面,现在我们如何知道用户是否已登录?

In views.py once the user logs in redirect to a url that calls a view

@login_required()
def login_success(request):

and render a welcome message

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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