1from django.contrib.auth.models import User, Group
2from django.db.models.signals import post_save
3from django.dispatch import receiver
4
5@receiver(post_save, sender=User)
6def create_user_profile(sender, instance, created, **kwargs):
7 if created:
8 instance.groups.add(Group.objects.get(name='group_name'))
9