我可以有两个共享相同身份验证模型的django项目吗? [英] Can I have two django projects sharing the same authentication model?

查看:83
本文介绍了我可以有两个共享相同身份验证模型的django项目吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个非常相关的站点,希望使用它们的用户只需要登录一次。



在一个django项目下,有两个应用程序服务于不同的域吗?





是否可以通过某种方式在两个独立的django项目之间共享身份验证? / p>

欢呼



Asim

解决方案

有很多方法可以解决此问题。这里有一些事情值得研究。我正在根据自己的喜好进行订购,如果您有一些问题,或更具体的问题可能会有所改变。




  • 使用相同的数据库。

  • 为一个站点提供另一个站点的OpenID提供程序

  • 使用Django的MultiDB功能(注意!数据库,所以不要尝试,如果您没有真正理解到这个含义)


I have two very related sites, would like users using each to only to have to login once.

Either two apps under one django project serving different domains? Is this possible?

or

is there some way to share the authentication between two separate django projects?

Cheers

Asim

解决方案

There are lots of ways you can solve this problem. Here are some things to look into. I'm ordering based on my preference, if you've got some questions, or more specificity to your question, it could change.

  • Use the same database.
  • Make one site an OpenID provider for the other
  • Use Django's MultiDB functionality (NOTE! You can't Foreign Key between databases, so don't try if you don't really get the implications of this)

这篇关于我可以有两个共享相同身份验证模型的django项目吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆