【发布时间】:2012-11-13 11:06:04
【问题描述】:
我正在为 django 打开 shell 命令 python manage.py shell
from django.contrib.auth import authenticate
print authenticate(username='q80', password='nokia6230') #result q80
现在如果我登录 django 管理站点 /admin 并更改密码并返回shell 如果我使用旧值仍然可以验证!
from django.contrib.auth import authenticate
print authenticate(username='q80', password='newpassword') #result None
print authenticate(username='q80', password='nokia6230') #result q80
如果关闭 shell 会话并再次打开它的工作!
我怎样才能有实时变化的效果!?
【问题讨论】:
-
您在管理员上更改密码后是否尝试检查数据库是否有任何更改?我还想知道您的任何身份验证后端是否正在缓存
-
我检查了,除了在shell中,它已成功更改!我应该退出然后重新加载
标签: python django authentication real-time django-authentication