1👍
✅
First try to use this command line utility provided in Django:
https://github.com/django/django/blob/1.6.5/django/contrib/contenttypes/management.py
to fill up content types table (which should be somewhere over there also). After that you can try to fill up permission table with default ones for all of your apps (installed in INSTALLED_APPS
in your settings.py
). You can us utility function create_permissions
from here:
https://github.com/django/django/blob/1.5/django/contrib/auth/management/init.py
It would be something like:
from django.contrib.contenttypes.management import update_all_contenttypes
from django.contrib.auth.management import create_permissions
from django.db.models import get_apps
update_all_contenttypes()
for app in get_apps():
create_permissions(app, None, 2)
Source:stackexchange.com