Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
尝试使用django social auth连接到twitter时出错_Django_Django Socialauth_Django Apps - Fatal编程技术网

尝试使用django social auth连接到twitter时出错

尝试使用django social auth连接到twitter时出错,django,django-socialauth,django-apps,Django,Django Socialauth,Django Apps,在/complete/twitter上导入/ 没有名为social.pipeline的模块 我在尝试将twitter连接到我的项目时出现了这个错误。这是完整的回溯 任何人都知道如何解决这个问题 环境: Request Method: GET Request URL: http://127.0.0.1:8000/complete/twitter/? oauth_token=gqaWZAszthiQJEUaZHF72U1y7hGimCLGSGxr6YLUU&oauth_

在/complete/twitter上导入/ 没有名为social.pipeline的模块 我在尝试将twitter连接到我的项目时出现了这个错误。这是完整的回溯 任何人都知道如何解决这个问题

环境:

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
表单设置.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',
)

与这个问题没有直接关系,但这是谷歌搜索这个错误时显示的唯一相关页面,所以我将发布这篇文章,希望犯同样错误的人也能看到它。我得到的错误是:

ImportError at /complete/facebook/
No module named pipeline.social_auth
我得到这个错误是因为我试图将
django-social-auth
管道与
python-social-auth
一起使用。如果您使用的是
python-social-auth
,则需要以下内容:

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'
)

从social\u auth/backends/\uuu init\uuuuuuuuuy.py显示
管道。和
设置.py中的
'SOCIAL\u AUTH\u PIPELINE'
,如果存在的话。@很快从设置.py添加了SOCIAL\u AUTH\u PIPELINE解决了
'SOCIAL.PIPELINE…
行的问题。你确定,
social.pipeline
模块存在吗?@很快是的,它是应用程序中的一个文件夹尝试在django shell上导入,如果在那里引发导入错误,则导入路径错误,一旦获得正确的导入路径,请在设置中使用该值。