Django Facebook Connect 应用推荐
我想为我的 Django 网站实现 Facebook 连接登录,并且我已经检查了现有的应用程序。
到目前为止,我已经找到了Django-Socialauth,django-socialregistration 和 django-facebookconnect 为此目的。
问题是选择哪一个,我想听听其他拥有这些应用程序经验的开发人员的意见。
对我来说,重要的是 Facebook Connect 登录应用程序可以与 @login_required、默认身份验证系统和 django-registration 很好地配合。
请分享您的经验:)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
更新 (11/26/2013):我正在更新我的建议。由于自从我写这个答案以来已经过去了足够长的时间,我建议 python- Social-auth 或 django-allauth
我非常幸运地将 django-socialregistration 与 django-registration (0.8)。由于您正在使用 django-registration,因此您将需要做一些工作,因为所有这三个包都承担用户创建和身份验证的角色。
我只是想解释一下需要做什么,但你激励我最终得到了我的版本:你好-社交-注册。
就像我提到的,它将注册功能分离给 django 注册后端并自行处理所有授权。我已经在我的近乎测试版应用程序上使用它一段时间了,没有任何问题(几个月前我还把它交给了一位朋友使用,他无需太多修改就可以使用它)。
它肯定还没有准备好成为一个即插即用的可重用应用程序,但希望它能为您提供一些见解。 :)
Update (11/26/2013): I'm updating my recommendation. Since a sufficient amount of time has passed since I wrote this answer, I would recommend python-social-auth or django-allauth as the best tools for the job. They are active projects with good documentation and support for a lot more than just Facebook. I've had success using both.
I have had the most luck with adapting django-socialregistration with django-registration (0.8). Since you're working with django-registration, you're going to have to do a little bit of work, since all three of those packages assume the role of both the creation and the authentication of the user.
I was just going to explain what needed to be done, but you inspired me to finally get my version out: hello-social-registration.
Like I alluded to, it separates gives the registration functions to a django-registration backend and handles all the authorization itself. I've been using this on my near-beta application for a while now with no problems (I also handed it to a friend to use a few months ago and he got it to work without much modification).
It's definitely not ready to be a plug-and-play reusable application, yet, but hopefully it'll provide you with some insight. :)
到目前为止,Django 中最常用的 Facebook 身份验证包是 Django Facebook:
https://github.com/tschellenbach /Django-facebook
它还允许您使用附带的 Open Facebook api 客户端访问 facebook API。
By far the most commonly used package for Facebook authentication in Django is Django Facebook:
https://github.com/tschellenbach/Django-facebook
It also gives you access to the facebook APIs using the included Open Facebook api client.
我想在我的 Django 应用程序中实现基本的“使用 Facebook 登录”功能。我不想向用户展示要填写的表格或让她选择密码。我更喜欢让它无缝。
根据我的要求,django_facebook_oauth 对我来说是最好的应用程序。它只是允许用户使用 Facebook 登录,并从她那里获取我的 Facebook 应用程序请求的用户信息(基于我的 Facebook 身份验证对话框)。它使用用户的 Facebook 电子邮件、用户名和空白密码在 Django 中创建一个新用户。
我强烈推荐它。
I wanted to implement a basic "Login using Facebook" functionality in my Django app. I didn't want to show the user a form to fill or have her choose a password. I preferred to make it seamless.
Based on my requirements, django_facebook_oauth was the best app for me. It simply allows the user to login using facebook, and gets the user info my Facebook app requests from her (based on my Facebook Auth Dialog). It creates a new user in Django with the user's facebook email, a username and a blank password.
I highly recommend it.
您好,看看我们(实际上是 Hernani,我们团队中的一个人)为 osqa(CNPROG 的克隆)。
您可能需要进行一些修改才能适应您的需求。它确实可以与 @login_required 装饰器和标准 django.contrib.auth 系统配合使用,但我们不使用 django-registration 。
我们的应用程序也可以使用 openid 和密码登录,但 openid 部分目前与问答组件紧密耦合。
如果有人对“anything-signin”django 可插拔应用程序感兴趣或已经有更好的东西,我们可能会在将来的某个时候将其分开 - 请告诉我们。
Hi Take a look at fbconnect app that we (actually, Hernani, a guy on our team) put together for osqa (a clone of CNPROG).
You will have to, probably, tinker a bit to adapt that to your needs. It does work with
@login_required
decorator and the standarddjango.contrib.auth
system, but we do not usedjango-registration
.Our app also works with openid and password login, but the openid part is tightly coupled with the Q&A component at present.
We may separate it though some time in the future, if anyone might be interested in "anything-signin" django pluggable app or has something better already - pls let us know.
我在两个不同的项目中使用了 django-allauth 和 django-facebook 。
django-allauth 非常棒,为登录和创建用户配置文件提供了非常好的支持。它还可以与其他身份验证提供商一起使用,但我没有实现。
django-facebook 开箱即用,但它仅与 Facebook 兼容。它还提供了简单的 API,用于将用户的点赞和好友从 Facebook 直接提取到数据库中,我非常喜欢!
I've used django-allauth and django-facebook on two different projects.
django-allauth was great and provided very good support for logging in and creating user profiles. It could also work with other auth providers, which I didn't implement.
django-facebook worked out of the box, but it's only compatible with Facebook. It also provided simple APIs for fetching users' likes and friends from Facebook directly into the db, which I liked very much!
我使用了基于 .NET 的库,发现它们已经过时了,令人沮丧。 Facebook 似乎经常改变他们的 API,所以如果你找不到一个定期维护的库,你会发现你的实现已经进行了一半,然后你才意识到存在严重的问题。
我在 Facebook 发布和维护的 javascript API 方面取得了一些成功。虽然文档可能并不总是最新的,但我发现我总是距离正确的实现很近(需要一两个更改)。
I played with .NET based libraries and found them to be frustratingly out of date. Facebook seems to change their APIs frequently, so if you cannot find a library that is routinely maintained, you will find that you will get halfway through your implementation before you realize that there are serious problems.
I had some success with the javascript API that Facebook publishes and maintains. While the documentation may not be always up to date, I found that I was always within striking distance of the correct implementation (one or two changes needed).