One - One Code All

Blog Content

DJANGO ANONYMOUSUSER

Python   2018-04-20 19:40:18

AnonymousUser对象

class models.AnonymousUser


django.contrib.auth.models.AnonymousUser是一个实现django.contrib.auth.models.User接口的类,具有以下差异:


id始终是None。

username 永远是空字符串。

get_username() 总是返回空字符串。

is_anonymous是True 不是False。

is_authenticated是 False不是True。

is_staff并且 is_superuser永远 False。

is_active永远False。

groups并且 user_permissions总是空的。

set_password(), check_password(), save()和 delete()提高NotImplementedError。



上一篇:TensorRT的集成加速TensorFlow的推理
下一篇:airflow部署和使用,重启

The minute you think of giving up, think of the reason why you held on so long.