社区所有版块导航
Python
python开源   Django   Python   DjangoApp   pycharm  
DATA
docker   Elasticsearch  
aigc
aigc   chatgpt  
WEB开发
linux   MongoDB   Redis   DATABASE   NGINX   其他Web框架   web工具   zookeeper   tornado   NoSql   Bootstrap   js   peewee   Git   bottle   IE   MQ   Jquery  
机器学习
机器学习算法  
Python88.com
反馈   公告   社区推广  
产品
短视频  
印度
印度  
Py学习  »  问与答

请教,通过Authentication 系统登录后,怎么在request里获的上次的登录的时间?

645556350 • 11 年前 • 3945 次点击  

在官方文档里只找到user的几种方法,但没看到能 get_last_login 的方法: https://docs.djangoproject.com/en/1.8/ref/contrib/auth/#django.contrib.auth.models.AnonymousUser

class models.User

get_username()

is_anonymous()

is_authenticated()

get_full_name()

get_short_name()

请问是要自己去数据库里寻找。。。还是有其他我不知道的方法。

Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/1067
文章 [ 2 ]  |  最新文章 11 年前
younger.x.shen
Reply   •   1 楼
younger.x.shen    11 年前

存在数据库中了,你也可以存在cookie里

cdxfish
Reply   •   2 楼
cdxfish    11 年前

user.last_login 上次登录 user.date_joined 创建时间