Python 不验证用户django social auth?
用户单击链接/登录/steam。在这之后,所有的工作都正常(django.contrib.auth用户实例和social_auth用户实例创建良好的自定义管道工作。但是当我尝试在使用steam登录后在视图中使用request.user时,我出现了错误 “AnonymousUser”对象不可编辑 My settings.py文件Python 不验证用户django social auth?,python,django,django-socialauth,Python,Django,Django Socialauth,用户单击链接/登录/steam。在这之后,所有的工作都正常(django.contrib.auth用户实例和social_auth用户实例创建良好的自定义管道工作。但是当我尝试在使用steam登录后在视图中使用request.user时,我出现了错误 “AnonymousUser”对象不可编辑 My settings.py文件 SOCIAL_AUTH_PIPELINE = ( 'social.pipeline.social_auth.social_details', 'social.pipeli
SOCIAL_AUTH_PIPELINE = (
'social.pipeline.social_auth.social_details',
'social.pipeline.social_auth.social_uid',
'social.pipeline.social_auth.social_user',
# custom pipeline
'markers.pipeline.add_steam_data_marker',
#
'social.pipeline.user.get_username',
'social.pipeline.user.create_user',
'social.pipeline.social_auth.auth_allowed',
'social.pipeline.social_auth.associate_user',
'social.pipeline.social_auth.load_extra_data',
'social.pipeline.user.user_details', )
应用程序中的My custom pipeline.py
def add_steam_data_marker(strategy, details, backend, uid, *args, **kwargs):
if backend.name == 'steam':
try:
Model.objects.get(steam_user_id=uid)
return redirect('/home/')
except ObjectDoesNotExist:
Model.objects.create(
........,
)
return redirect('/model/add/')
所有的问题都是在身份验证方面我在Facebook上遇到了同样的问题。但是我使用的是社交核心。