Create Group Permissions with Migrations in Django

Here's an example migration for automatically creating permissions on groups.

This specific install uses both allauth and guardian which is reflected in the migration dependencies, but as this uses Django core Group and Permission objects, it should work without those two modules.

As noted in the gist, YMMV.

Published November 6, 2020