This is much harder than it needs to be.
See here and here. This issue won’t help.
(venv) $ ./manage.py dumpdata --indent=4 --natural-primary --natural-foreign -e contenttypes -e auth.Permission -e wagtailcore.groupcollectionpermission > dumpfile.json