简体   繁体   中英

Is it possible to authenticate against a single source from two distinct Django deployments?

I'm hoping there's a straightforward answer to this question.

First, some history: I deployed a Django project and it uses all of the authentication mechanisms provided in Django. Namely, users are stored in auth_users and my login app validates against the records found in that table.

Now, I have a second, distinct Django project that needs to authenticate against the database from the original application. I'm not entirely sure how can I approach the problem, so I'm hoping someone in the stackoverflow community can help.

One thought was to add "myfirstproject.login" to the INSTALLED_APPS of the second project, but I'm uncertain if that's a viable option (CSRF issues?). Again, any insight is appreciated.

Try the sites module? http://docs.djangoproject.com/en/1.3/ref/contrib/sites/

Create an auth backend? http://docs.djangoproject.com/en/1.3/topics/auth/#specifying-authentication-backends

Inherit from contrib.auth to create your own auth module?

CSRF would only be an issue if you were trying to authenticate by telling the client browser to ask the first site for auth; which is unlikely to be the best path to take.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM