首页 > 其他分享 >Cannot apply DjangoModelPermissionsOrAnonReadOnly on a view that does not set `.queryset` or have a

Cannot apply DjangoModelPermissionsOrAnonReadOnly on a view that does not set `.queryset` or have a

时间:2022-10-15 07:44:25浏览次数:42  
标签:set get queryset Cannot apply method DjangoModelPermissionsOrAnonReadOnly

这个问题是在使用 django REST 做自定义认证的时候出现的

 

解决方法是 在settings.py 中注释掉这个

REST_FRAMEWORK={
'DEFAULT_PERMISSION_CLASSES': [
'rest_framework.permissions.DjangoModelPermissionsOrAnonReadOnly',
]

}

标签:set,get,queryset,Cannot,apply,method,DjangoModelPermissionsOrAnonReadOnly
From: https://www.cnblogs.com/beichengshiqiao/p/16793521.html

相关文章