Can I have two django projects sharing the same authentication model?

会有一股神秘感。 提交于 2019-12-07 07:10:29

问题


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


回答1:


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)


来源:https://stackoverflow.com/questions/7699247/can-i-have-two-django-projects-sharing-the-same-authentication-model

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!