2011-03-05 33 views
0

我一直在使用django和openid來使用django-openid-consumer中間件,它通常工作。不過,我在使用Google應用中的帳戶登錄時遇到了問題(這會將我重定向到正常的Gmail帳戶)。谷歌員工建議安裝adieu-python-openid,據推測該程序包含一個處理Google OpenID隱藏的補丁。無論如何,安裝這個版本的openid後,我得到一個版本不匹配。我看到在adieu的init .py中聲明的版本。是否需要在課堂內聲明?adieu的openid修補程序導致django-openid-consumer中的不匹配

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

可能是補丁是爲openid的以前的版本編寫的嗎?而你正在使用的那個可能已經改變了模型。

相關問題