Skip to content

Instantly share code, notes, and snippets.

View naman's full-sized avatar
🌼
Focusing

Naman Gupta naman

🌼
Focusing
View GitHub Profile
@kouroshshafi
kouroshshafi / profile_picture_django_social_auth
Created January 23, 2012 12:39
Extending User class to save profile picture in django-social-auth when registering
# This is models.py for a new user profile that you would like to create.
"""
this gist gets an id from django-social-auth and based on that saves the photo from social networks into your model. This is one of the best ways to extend User model because this way, you don't need to redefine a CustomUser as explained in the doc for django-social-auth. this is a new implementation based on https://gist.github.com/1248728
"""
from django.contrib.auth.models import User
from django.db.models.signals import post_save
from django.db import models