这是我的项目目录:
/handshakeapp:
templates/
__init__.py
admin.py
models.py
pipelines.py
views.py
/VKHandshake:
__init__.py
settings.py
urls.py
...
manage.py
这是一部分settings.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.social_auth.associate_user',
'social.pipeline.social_auth.load_extra_data',
'social.pipeline.user.user_details',
'handshakeapp.pipelines.fill_extendeduser'
)
这是handshakeapp/pipelines.py
:
from models import ExtendedUser
def fill_extendeduser(strategy, details, user=None, is_new=False, *args, **kwargs):
if user and is_new:
user.extendeduser_set.create(user=user.get_username(), countingID=None, profilePic='http://localhost:8000/pic.png')
但它会重定向到/accounts/login/
每次我尝试使用社交身份验证登录时。如果我'handshakeapp.pipelines.fill_extendeduser'
从 SOCIAL_AUTH_PIPELINE 中删除,它会起作用。怎么了?