如何在django中拥有两个独立的身份验证系统?

Ami*_*dav 1 django django-authentication

我需要有两个不同的登录/注册系统.

1: One for the general user.
2: Second for the Channels admin.

Both will have different email id, password etc in two different tables. 
For the general     user it will go in the `auth_user` table and for the channel 
it I'd be creating another different models/table.
Run Code Online (Sandbox Code Playgroud)

我知道django提供了一个完整的身份验证系统,我可以为普通用户使用.但是如何同时在渠道管理员的情况下实现相同的功能呢?

我试着查看django的文档中的AUTHENTICATION_BACKENDSAUTH_USER_MODEL,

我无法理解如何为频道管理部分设置会话.

所以,如果有人能够让我知道如何以及如何同时实现这两者的方法.

Pet*_*ell 5

您想在Django中查看自定义身份验证.您可以根据需要使用多种不同的方式进行身份验证.存储在会话记录中的部分信息是成功使用了哪个身份验证后端.它略有参与,但它们为您提供了所有必要的控制,可以随心所欲地完成任何操作.

几年前我在一个系统上使用它,主要用户/密码信息来自外部订阅管理服务器.如果用户/通行证在普通的User-auth系统上不起作用,我检查了另一个系统.如果成功,我会动态创建一个新用户.