使用来自多个应用程序的django身份验证系统

时间:2022-11-19 10:22:17

I am developing django base web service now and I am confused.

我现在正在开发django基础Web服务,我很困惑。

I have three projects as a django projects.

我有三个项目作为django项目。

app1 - use from the end user

app1 - 从最终用户使用

app2 - use from the service providor

app2 - 使用服务提供商

app3 - use from the operator(administrator)

app3 - 来自运营商(管理员)的使用

I made one database from app3(migration) and I created symbolic links (models.py, migrations dir) to app1 and app2.

我从app3(迁移)创建了一个数据库,并创建了符号链接(models.py,migrations dir)到app1和app2。

And then I try to use user authentication system of django from my app1, I got a following error.

然后我尝试从我的app1使用django的用户身份验证系统,我收到了以下错误。

The above exception (relation "myapp1_user" does not exist LINE 1: ...myapp1_user"."modify_date" FROM ^ ) was the direct cause of the following exception:

上面的异常(关系“myapp1_user”不存在LINE 1:... myapp1_user“。”modify_date“FROM ^)是以下异常的直接原因:

I know what is wrong. It's because I don't have myapp1_user table on my database. I only have app3_user table.

我知道出了什么问题。这是因为我的数据库上没有myapp1_user表。我只有app3_user表。

But I have no idea how can I configure to work well. Does somebody have any idea? Please let me know.

但我不知道如何配置才能正常工作。有人有什么想法吗?请告诉我。

1 个解决方案

#1


0  

when a user signup to app give there three options end user, service provider, administrator. take these fields in BooleanField. so when the user going to sign in then check the true and false for these three user accounts and whichever condition appeaser as true that will be executed.

当用户注册到应用程序时,最终用户,服务提供商,管理员可以选择三个选项。在BooleanField中获取这些字段。因此,当用户要登录时,请检查这三个用户帐户的真假,以及将要执行的任何条件的追加者。

#1


0  

when a user signup to app give there three options end user, service provider, administrator. take these fields in BooleanField. so when the user going to sign in then check the true and false for these three user accounts and whichever condition appeaser as true that will be executed.

当用户注册到应用程序时,最终用户,服务提供商,管理员可以选择三个选项。在BooleanField中获取这些字段。因此,当用户要登录时,请检查这三个用户帐户的真假,以及将要执行的任何条件的追加者。