defining a custom post_migrate signal
I'm doing some kind of refactoring for my project, where I'm relying on the django django.contrib.auth.models.Permission model. So far I define the permissions for each new user using a post_save signal, so when the user is created, I assign their permissions using user.user_permissions.add(the_permission) , this works perfectly. Now I want to use the django.contrib.auth.models.Group model to clasify the permissions a user should have. This is my code: from django.apps import AppConfig from django.db.models.signals import post_migrate from django.contrib.auth.models import Group, Permission