social-app-django
social-app-django copied to clipboard
How can I use this package with my custom user model?
Hi, I am a bit lost! How can I use this package with my custom user model? Any examples/tutorials out there?
Depends a bit on your custom user model.
If the custom user model does not have any new required fields (that do not have default value), you need to do nothing.
If there is such fields, you need to add function(s) to the auth pipeline that get the required data from auth if the data is not mapped already by https://github.com/python-social-auth/social-core/blob/master/social_core/pipeline/social_auth.py#L4 (assuming you have this in your SOCIAL_AUTH_PIPELINE)
By default the user object is created by https://github.com/python-social-auth/social-core/blob/master/social_core/pipeline/user.py#L68
The relevant documentation is in https://python-social-auth.readthedocs.io/en/latest/pipeline.html#authentication-pipeline