Created
March 4, 2018 14:45
-
-
Save gauravtoshniwal1989/2288a6d2e0a65a821a46129f5a59d4f8 to your computer and use it in GitHub Desktop.
Create ContentTypes and Permissions in Django
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.apps.registry import Apps | |
app_config = apps.get_app_config('<app_name>') | |
# To create Content Types | |
from django.contrib.contenttypes.management import create_contenttypes | |
create_contenttypes(app_config) | |
# To create Permissions | |
from django.contrib.auth.management import create_permissions | |
create_permissions(app_config) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment