I’m using Django-social-auth for the first time, and it seems that all the new users are registered in the User’s model of the social_auth app of my Django website. I have a different model called Users which has some specific data (related to the users activity in the site and relation with other entities) and I want to put the data fetched from users’ Facebook profiles (username, profile picture etc) into the Users model that I made myself. is there any way to extend the social_auth Users?
EDIT
After reading the Django-social-auth documentation, i edited my User class as follow :
# User model
class User(models.Model):
username = models.CharField(max_length=30)
last_login = models.DateTimeField(blank=True)
is_active = models.BooleanField(default=False)
playedHours = models.FloatField(default = 0)
userSlug = models.SlugField(unique = True)
playedSongs = models.ManyToManyField(Song, blank=True, null = True)
invitedFriends = models.ManyToManyField('self', blank = True, null = True)
def __unicode__(self):
return self.name
Also, how can i get the user’s profile picture, friends list and so on?
I dont understand the mechanism of this.
Thanks a lot !
I created a custom Manager class as required, and called it
CustomUserManager.Here is the code:
then I changed my User class to:
In my settings.py :
Thanks ArgsKwargs for the help 🙂