2013-05-02 81 views
0

導入錯誤/ 無模塊social.pipeline命名 我不得不當我試圖給Twitter連接到我的項目這個錯誤,這是完全回溯 任何身體有任何想法如何解決呢錯誤,當試圖連接AT /完整/嘰嘰喳喳Django的社會身份驗證嘰嘰喳喳

環境:

Request Method: GET 
Request URL: http://127.0.0.1:8000/complete/twitter/?   oauth_token=gqaWZAszthiQJEUaZHF72U1y7hGimCLGSGxr6YLUU&oauth_verifier=YAkKy9Q71YrScl1psUXBApx XeQITAcDm6ObCoxdjc 

Django Version: 1.5 
Python Version: 2.7.3 
Installed Applications: 
('django.contrib.auth', 
'django.contrib.contenttypes', 
'django.contrib.sessions', 
'django.contrib.sites', 
'django.contrib.messages', 
'django.contrib.staticfiles', 
'django.contrib.admin', 
'tager_www', 
'fbregister', 
'captcha', 
'django_twilio', 
'social_auth') 
Installed Middleware: 
('django.middleware.common.CommonMiddleware', 
'django.contrib.sessions.middleware.SessionMiddleware', 
'django.contrib.auth.middleware.AuthenticationMiddleware', 
'django.contrib.messages.middleware.MessageMiddleware') 


Traceback: 
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response 
115.       response = callback(request, *callback_args, **callback_kwargs) 
File "/usr/local/lib/python2.7/dist-packages/django/views/decorators/csrf.py" in wrapped_view 
77.   return view_func(*args, **kwargs) 
File "/usr/local/lib/python2.7/dist-packages/django_social_auth-0.7.23- py2.7.egg/social_auth/decorators.py" in wrapper 
29.    return func(request, request.social_auth_backend, *args, **kwargs) 
File "/usr/local/lib/python2.7/dist-packages/django_social_auth-0.7.23- py2.7.egg/social_auth/views.py" in complete 
41.   return complete_process(request, backend, *args, **kwargs) 
File "/usr/local/lib/python2.7/dist-packages/django_social_auth-0.7.23-py2.7.egg/social_auth/views.py" in complete_process 
107.  user = auth_complete(request, backend, *args, **kwargs) 
File "/usr/local/lib/python2.7/dist-packages/django_social_auth-0.7.23-py2.7.egg/social_auth/views.py" in auth_complete 
190.  return backend.auth_complete(user=user, request=request, *args, **kwargs) 
File "/usr/local/lib/python2.7/dist-packages/django_social_auth-0.7.23-py2.7.egg/social_auth/backends/twitter.py" in auth_complete 
87.    return super(TwitterAuth, self).auth_complete(*args, **kwargs) 
File "/usr/local/lib/python2.7/dist-packages/django_social_auth-0.7.23-py2.7.egg/social_auth/backends/__init__.py" in auth_complete 
656.   return self.do_auth(access_token, *args, **kwargs) 
File "/usr/local/lib/python2.7/dist-packages/django_social_auth-0.7.23-py2.7.egg/social_auth/backends/__init__.py" in do_auth 
672.   return authenticate(*args, **kwargs) 
File "/usr/local/lib/python2.7/dist-packages/django/contrib/auth/__init__.py" in authenticate 
59.    user = backend.authenticate(**credentials) 
File "/usr/local/lib/python2.7/dist-packages/django_social_auth-0.7.23-py2.7.egg/social_auth/backends/__init__.py" in authenticate 
107.   out = self.pipeline(pipeline, *args, **kwargs) 
File "/usr/local/lib/python2.7/dist-packages/django_social_auth-0.7.23-py2.7.egg/social_auth/backends/__init__.py" in pipeline 
132.    mod = import_module(mod_name) 
File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py" in import_module 
35.  __import__(name) 

Exception Type: ImportError at /complete/twitter/ 
Exception Value: No module named social.pipeline 

形式settings.py:

SOCIAL_AUTH_PIPELINE = (
'social_auth.backends.pipeline.social.social_auth_user', 
'social_auth.backends.pipeline.associate.associate_by_email', 
'social_auth.backends.pipeline.misc.save_status_to_session', 
'social.pipeline.redirect_to_form', 
'social.pipeline.username', 
'social_auth.backends.pipeline.user.create_user', 
'social_auth.backends.pipeline.social.associate_user', 
'social_auth.backends.pipeline.social.load_extra_data', 
'social_auth.backends.pipeline.user.update_user_details', 
'social_auth.backends.pipeline.misc.save_status_to_session', 
'social.pipeline.redirect_to_form2', 
'social.pipeline.first_name', 
) 
+0

顯示'PIPELINE'。並且'settings.py'中的''SOCIAL_AUTH_PIPELINE'',如果存在。 – soon 2013-05-02 07:38:28

+0

@soon完成從settings.py中添加SOCIAL_AUTH_PIPELINE – user2287768 2013-05-02 07:47:42

+0

「social.pipeline ...」行的問題。你確定,'social.pipeline'模塊存在嗎? – soon 2013-05-02 07:54:43

回答

1

與問題沒有直接關係,但這是Google在搜索此錯誤時顯示的唯一相關頁面,因此我會發布此信息希望有人犯同樣的錯誤將會看到它。我得到的錯誤是:

ImportError at /complete/facebook/ 
No module named pipeline.social_auth 

我,因爲我是想用python-social-auth使用django-social-auth管道得到這個錯誤。如果你正在使用python-social-auth,則需要以下內容:從_social_auth /後端/ \ _ \ _ INIT \ _ \ _ py_

SOCIAL_AUTH_PIPELINE = (
    'social.pipeline.social_auth.social_details', 
    'social.pipeline.social_auth.social_uid', 
    'social.pipeline.social_auth.auth_allowed', 
    'social.pipeline.social_auth.social_user', 
    'social.pipeline.user.get_username', 
    #'social.pipeline.social_auth.associate_by_email', 
    'social.pipeline.user.create_user', 
    'social.pipeline.social_auth.associate_user', 
    'social.pipeline.social_auth.load_extra_data', 
    'social.pipeline.user.user_details' 
) 

More details can be found here.