开发者

modify admin auth backend

By default, after authentication on /admin, function authenticate() returns User object,

what if i want to get proxy model for the User (i.g. called HandyUser) in return ? In my pr开发者_C百科oject, in all custom auth backends, i'm using HandyUser instead of User.

thanks


According to the django docs http://docs.djangoproject.com/en/dev/topics/auth/#storing-additional-information-about-user, you need to add to your settings file:

AUTH_PROFILE_MODULE = 'app.HandyUser'

And then when you reference your User class, call the user.get_profile method which will return the instance of HandyUser.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜