code: def get_app_perms(model_or_app_label):
      
      from django.contrib.auth.models import Permission
      if isinstance(model_or_app_label, string_types):
          app_label = model_or_app_label
      else:
          # assume model_or_app_label is model class
          app_label = model_or_app_label._meta.app_label
      qs = Permission.objects.filter(content_type__app_label=app_label)
      perms = ('%s.%s' % (app_label, p.codename) for p in qs.iterator())
      return set(perms)
docs: Get permission-string list of the specified django application.
  
      Parameters
      ----------
      model_or_app_label : model class or string
          A model class or app_label string to specify the particular django
          application.
  
      Returns
      -------
      set
          A set of perms of the specified django application.
  
      Examples
      --------
      >>> perms1 = get_app_perms('auth')
      >>> perms2 = get_app_perms(Permission)
      >>> perms1 == perms2
      True