我们从Python开源项目中,提取了以下1个代码示例,用于说明如何使用django.contrib.auth.mixins.PermissionRequiredMixin()。
def my_view(request): #PermissionRequiredMixin from django.contrib.auth.mixins import PermissionRequiredMixin class MyView(PermissionRequiredMixin, View): permission_required = 'polls.can_vote' # Or multiple of permissions: permission_required = ('polls.can_open', 'polls.can_edit') #AccessMixin