开发者

Request.User with custom auth backend

开发者 https://www.devze.com 2023-02-11 05:26 出处:网络
i implemented custom simple auth backend (two methods - authenticate and get_user, nothing special), now i could successfully authenticate and login my customUser, but what should i need to do to have

i implemented custom simple auth backend (two methods - authenticate and get_user, nothing special), now i could successfully authenticate and login my customUser, but what should i need to do to have possibility call request.user with my customUser in the views methods? For now it just give me an error 'WSGIRequest' object has no attribute 'user'

UPD. Turns out, i forg开发者_开发技巧ot to add default 'django.contrib.auth.middleware.AuthenticationMiddleware' in settings.py. It worked now

0

精彩评论

暂无评论...
验证码 换一张
取 消