cost 65 ms
有没有办法只显示一些 model 字段? - Is there a way to show only some model fields?

我有一个带有字段实例和视图的 model。 我可以做这样当你重定向到主页时你只能看到 ID、标题、截止日期、完成吗? 但是当您重定向到详细信息页面时,您可以看到所有 model 字段。 模型.py: 意见.py: 序列化器.py: 网址.py: 请添加指向有用阅读材料的链接 ...

Python 请求与 Django Rest 框架 - “详细信息”:“未提供身份验证凭据” - Python Requests with Django Rest Framework - 'detail': 'Authentication credentials were not provided'

我有一个很小的 function,它只是看起来从我的 DRF API 端点得到响应。 我的 DRF 设置如下所示: 我正在使用它来尝试达到终点: 我不断收到'detail': 'Authentication credentials were not provided' 我是否需要生成 CSRF 令 ...

has_object_permission 和 has_permission 之间有什么区别? - What's the differences between has_object_permission and has_permission?

我对BasePermission中的 BasePermission 感到困惑。 这里我定义了一个 class: IsAuthenticatedAndOwner 。 在views.py中使用 但它根本不起作用。 每个人都可以通过权限并更新数据。 未打印called 。 我曾经定义过这个 class: ...


排序:
质量:
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM