问题
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