My Django project lets users log in with a Google or Facebook profile, using python-social-auth's django integration.
Once they've logged in, is there a way to get a link to their profile on Google or Facebook? I'm trying to do something like this:
from django.db.models.signals import post_save
from django.dispatch import receiver
from django.contrib.auth.models import User
from django.core.mail import mail_admins
@receiver(post_save, sender=User)
def alert_new_user(sender, **kwargs):
instance = kwargs['instance']
social = instance.social_auth.last() # Assuming .last() gives me the one just added
if social is not None:
mail_admins('New user resistration',
'A new user registered with name {}'.format(instance.get_full_name()),
'<html><head/><body>A new user, <a href="{}">{}</a>, registered.</body></html>'.format(
???What goes here???, instance.get_full_name()
)
)