谷歌应用引擎上的django-social-auth

时间:2012-01-29 21:46:32

标签: django google-app-engine django-socialauth

我无法让django-social-auth与我使用djangoappengine和django-nonrel在Google的App Engine上部署的Django应用程序一起工作。

我是这里的菜鸟,对我来说非常复杂! 我使用此django-nonrel template开始使用video,虽然我获得了登录页面,但它总是给我错误 - Incorrect authentication service。 如果我没有为Google-oauth2定义消费者密钥和密钥,那么我在Google的页面上会出现invalid client错误。

当我运行测试social_auth时,我遇到了问题Ensure that the backend for the testcase gets cached.并且失败了(错误= 9) self.assertTrue(self.user) AssertionError: None is not true for all the errors

有人可以告诉我我接下来要做什么才能让它发挥作用?万分感谢!

2 个答案:

答案 0 :(得分:4)

我刚陷入这个问题,并认为即使你已经解决了这个问题,如果答案存在,对其他人也会有所帮助。

转到httplib2主页并下载最新版本。 提取存档并移动项目主文件夹中的内部httplib2文件夹(位于python2子文件夹中)。 然后最后在您的INSTALLED_APPS部分中添加'httplib2',在social_auth的依赖项之上。

例如,这是我的INSTALLED_APPS:

INSTALLED_APPS = (
    'django.contrib.contenttypes',
    'django.contrib.auth',
    'django.contrib.sessions',
    'djangotoolbox',
    'autoload',
    'dbindexer',
    'httplib2',#    These 4 are
    'openid',#      what u need to
    'oauth2',#      integrate social_auth plug
    'social_auth',# in your GAE project
    'myapp',
    'djangoappengine',
)

注意:您还必须放置在您的项目文件夹中:openid,oauth2和social_auth,因为您无法在GAE上安装它们。

答案 1 :(得分:0)

非常感谢您的回答Thodoris,

刚刚完成: