我一直在使用django和openid使用django-openid-consumer中间件,这通常都适用。但是,我在使用Google应用程序中的帐户登录时遇到了问题(这会将我重定向到我的普通Gmail帐户)。一位谷歌员工建议安装adieu-python-openid,据说其中包含一个处理谷歌OpenID默默无闻的补丁。无论如何,安装此版本的openid后,我的版本不匹配。我看到在adieu的 init .py中声明的版本。是否还需要在类中声明?
Environment:
Request Method: GET
Request URL: http://innovationsimple.net/testapp/openid/complete/?janrain_nonce=2011-03-05T15%3A27%3A04Zx26tny&openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0&openid.mode=id_res&openid.op_endpoint=https%3A%2F%2Fwww.google.com%2Faccounts%2Fo8%2Fud&openid.response_nonce=2011-03-05T15%3A27%3A08Zk4PS-g2XYczSVw&openid.return_to=http%3A%2F%2Finnovationsimple.net%2Ftestapp%2Fopenid%2Fcomplete%2F%3Fjanrain_nonce%3D2011-03-05T15%253A27%253A04Zx26tny&openid.assoc_handle=AOQobUcnYBDagAx3JaBN3y5YODDaZqypJ1Se-IZTcZwnbmSk65JH2VV2&openid.signed=op_endpoint%2Cclaimed_id%2Cidentity%2Creturn_to%2Cresponse_nonce%2Cassoc_handle%2Cns.ext1%2Cext1.mode%2Cext1.type.email%2Cext1.value.email&openid.sig=XG5sa7SwTMptLa2LOMqt5sNS9x0%3D&openid.identity=https%3A%2F%2Fwww.google.com%2Faccounts%2Fo8%2Fid%3Fid%3DAItOawku4cndu1aLsJt3DcI4yKyFPMU2JoOeggA&openid.claimed_id=https%3A%2F%2Fwww.google.com%2Faccounts%2Fo8%2Fid%3Fid%3DAItOawku4cndu1aLsJt3DcI4yKyFPMU2JoOeggA&openid.ns.ext1=http%3A%2F%2Fopenid.net%2Fsrv%2Fax%2F1.0&openid.ext1.mode=fetch_response&openid.ext1.type.email=http%3A%2F%2Faxschema.org%2Fcontact%2Femail&openid.ext1.value.email=strattonbrazil%40gmail.com
Django Version: 1.2.5
Python Version: 2.4.3
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'staticfiles',
'django_openid_consumer',
'django.contrib.admin',
'django.contrib.admindocs',
'crm']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django_openid_consumer.middleware.OpenIDMiddleware',
'django.middleware.csrf.CsrfViewMiddleware')
Traceback:
File "/usr/lib/python2.4/site-packages/django/core/handlers/base.py" in get_response
100. response = callback(request, *callback_args, **callback_kwargs)
File "/usr/lib/python2.4/site-packages/django_openid_consumer-0.1.1-py2.4.egg/django_openid_consumer/views.py" in complete
154. return on_success(request, openid_response.identity_url, openid_response)
File "/usr/lib/python2.4/site-packages/django_openid_consumer-0.1.1-py2.4.egg/django_openid_consumer/views.py" in default_on_success
172. request.session['openids'].append(from_openid_response(openid_response))
File "/usr/lib/python2.4/site-packages/django_openid_consumer-0.1.1-py2.4.egg/django_openid_consumer/util.py" in from_openid_response
123. if openid.__version__ < '2.1.0':
Exception Type: AttributeError at /openid/complete/
Exception Value: O
OpenID instance has no attribute '__version__'
答案 0 :(得分:0)
可能是补丁是为以前版本的openid编写的吗?而你正在使用的那个可能已经改变了模型。