私はpython-social-authの部分パイプラインを使って新しいユーザのパスワードを収集しようとしています。未知の理由により、私はパイプラインを再開することができません。フォームを送信した後、ページはパスワードコレクションページにレンダリングされます。python-social-auth部分パイプラインが再開できません
私はhttp .../complete/backend-nameと入力しても、ページはパスワードコレクションページにリダイレクトされます。レンダリングが無限ループになるように見えますが、パスワードコレクションページの最初の部分は完全なページに、完全なページはパスワードコレクションページに直接戻ります。 REDIRECT_FIELD_NAMEの値を確認しました。「次へ」です。
私のコードに何が問題なのかよく分かりませんが、ヒントや提案は大変ありがたいです。
settings.py
SOCIAL_AUTH_PIPELINE = (
...
'accounts.pipeline.get_password',
...
)
pipeline.py
from django.shortcuts import redirect
from social.pipeline.partial import partial
@partial
def get_password(strategy, details, user=None, is_new=False, *args, **kwargs):
if is_new:
return redirect('accounts_signup_social')
else:
return
views.py
def get_password(request):
if request.method == 'POST':
request.session['password'] = request.POST.get('password')
backend = request.session['partial_pipeline']['backend']
return redirect('social:complete', backend=backend)
return render_to_response('accounts/social_signup.html',{"form":SocialSignUpForm}, RequestContext(request))
をkwargsから[「要求」]はセッション属性を持っているのでしょうか?それともエラーですか? – sergiuz
[docs](http://psa.matiasaguirre.net/docs)に示されているように、 'kwargs ['request']。session ['psssword']'の代わりに '' strategy.session_get( 'password' /use_cases.html#pass-custom-get-post-parameters-and-retrieve-them-on-authentication) – ajaali