Last active
January 14, 2021 05:58
-
-
Save revolunet/5104376 to your computer and use it in GitHub Desktop.
Sample custom pipeline for django-social-auth and Facebook backend. Goal is to ask more info to the user before creating the account and the related Customer model.
How to run it, where is facebook.py?
Why am I getting this error can someone please help me out
The requested URL /oauth/complete/github/login.views.require_email was not found on this server.
This is my code for asking a user to register his email after github oauth. It works perfectly till the partial method. Once it transfers to views.py that is where the error occurs
settings.py
SOCIAL_AUTH_PIPELINE = (
'social_core.pipeline.social_auth.social_details',
'social_core.pipeline.social_auth.social_uid',
'social_core.pipeline.social_auth.auth_allowed',
'hello_world_blog.pipeline.collect_password',
'social_core.pipeline.social_auth.social_user',
'social_core.pipeline.social_auth.associate_user',
'social_core.pipeline.social_auth.load_extra_data',
'social_core.pipeline.user.user_details',
)
pipeline.py
@partial
def collect_password(strategy, backend, request, details, *args, **kwargs):
print("partial called")
return redirect('login.views.require_email')
login.views
def require_email(request):
print("called require_email view")
return render(request, 'registration/email.html', args)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is this still supported with the migrations that happened with the project?