def user_autocreate_handler(sender, instance, created, **kwargs):
 if created:
  try:
   profile = instance.profile
  except:
   profile = User(user=instance)
   profile.save()

def user_autocreate_handler ( sender , instance , created , ** kwargs ) : if created : try : profile = instance . profile except : profile = User ( user = instance ) profile . save ( )
when a django user is created .