# -*- coding: utf-8 -*- from django.contrib.auth.models import User from django.db import models class UserProfile(models.Model): ''' Special User for Ionyse ''' user = models.ForeignKey(User, unique=True) def createUserProfile(sender, instance, **kwargs): """ Create a UserProfile object each time a User is created ; and link it. """ UserProfile.objects.get_or_create(user=instance) models.signals.post_save.connect(createUserProfile, sender=User)