Всем привет! Хочу чтобы при создании модели user создавался UserProfile .
Делаю так:
@receiver(post_save, sender=User)
def create_user_profile(sender, instance, created, **kwargs):
if created:
UserProfile.create(user=instance)
Дает ошибку
AttributeError: 'User' object has no attribute 'profile'
Это надо расширить user и добавить в него Profile аттрибут?