I have a bunch of new permissions which I need to migrate. I tried doing it through data migration but complains about ContentType not being available
.
Here is a quick and dirty way to ensure all permissions for all apps have been created:
def add_all_permissions():
from django.apps import apps
from django.contrib.auth.management import create_permissions
for app_config in apps.get_app_configs():
app_config.models_module = True
create_permissions(app_config, verbosity=0)
app_config.models_module = None