from django.contrib.auth.decorators import permission_required # permission = 'applicationName.permission' # Ex. permission = "main.add_post" @permission_required(permission, login_url="/login", raise_exception=True) def view(request): ...