我正在打开django的shell命令 python管理.py贝壳
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会话在单个事务中工作,而不会看到来自外部的更新。只要退出shell并重新加载,就会看到更新的密码。你知道吗
相关问题 更多 >
编程相关推荐