[Django]-How do I programmatically create a user with django_social_auth?

1๐Ÿ‘

I have recently done the similar customization. You have to override the default SOCIAL_AUTH_PIPELINE. I would recommend you to write some handler and replace the same in the pipeline. For more details you can refer http://django-social-auth.readthedocs.org/en/latest/pipeline.html

My enhanced pipeline:

SOCIAL_AUTH_PIPELINE = (
                'social_auth.backends.pipeline.social.social_auth_user',
                # Removed by default since it can be a dangerouse behavior that
                # could lead to accounts take over.
                #'social_auth.backends.pipeline.associate.associate_by_email',
                'social_auth.backends.pipeline.user.get_username',
                #'social_auth.backends.pipeline.user.create_user',
                'myproject.custom.create_user',
                'social_auth.backends.pipeline.social.associate_user',
                #'social_auth.backends.pipeline.social.load_extra_data',
                'myproject.custom.load_extra_data',
                'social_auth.backends.pipeline.user.update_user_details',
           )

Leave a comment