简体   繁体   English

Django:“详细信息”:“未提供身份验证凭据。”

[英]Django : “detail”: “Authentication credentials were not provided.”

I'm using django rest framework. 我正在使用django rest框架。 These are my settings for REST FRAMEWORK, 这些是我对REST FRAMEWORK的设置,

REST_FRAMEWORK = {
    'DEFAULT_AUTHENTICATION_CLASSES': (
        'rest_framework.authentication.SessionAuthentication',
    ),
    'DEFAULT_PERMISSION_CLASSES': (
        'rest_framework.permissions.IsAuthenticatedOrReadOnly',
    )
    # 'DEFAULT_PERMISSION_CLASSES': (
    #     'rest_framework.permissions.IsAuthenticated',
    # ),
}

When I post to a simple endpoint, I get the following error, 当我发布到一个简单的端点时,出现以下错误,

{
    "detail": "Authentication credentials were not provided."
}

What am I doing wrong here. 我在这里做错了。 Any help appreciated. 任何帮助表示赞赏。

您正在执行POST请求,同时将默认权限类( IsAuthenticatedOrReadOnly )设置为仅允许未经授权的GETHEADOPTIONS请求

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Django Rest Framework {“detail”:“未提供身份验证凭据。”} - Django Rest Framework {“detail”:“Authentication credentials were not provided.”} DRF:“详细信息”:“未提供身份验证凭据。” - DRF: “detail”: “Authentication credentials were not provided.” 自定义Django休息框架身份验证响应{“详细信息”:“未提供身份验证凭据。”} - Customize Django rest framework authentication response {“detail”: “Authentication credentials were not provided.”} Django-rest-framework {“详细信息”:“未提供身份验证凭据。” } 使用 django-rest-knox - Django-rest-framework {“detail”: “Authentication credentials were not provided.” } using django-rest-knox "detail": "未提供身份验证凭据。" 一般视图 - "detail": "Authentication credentials were not provided." for general views "detail": "未提供身份验证凭据。" Django-rest-frameweork 和 React - "detail": "Authentication credentials were not provided." Django-rest-frameweork and React django rest API开发使用Swagger UI,有“详细信息”:“未提供身份验证凭据。” - django rest API development Using Swagger UI, got“detail”: “Authentication credentials were not provided.” 禁止:/api/v1.0/user/create-user/ & {“detail”:“未提供身份验证凭据。” } DJANGO - Forbidden: /api/v1.0/user/create-user/ & { "detail": "Authentication credentials were not provided." } DJANGO Django Rest Framework JWT“未提供身份验证凭据。”} - Django Rest Framework JWT “Authentication credentials were not provided.”} Django OAuth 工具包 - 自省请求:“未提供身份验证凭据。” - Django OAuth Toolkit - Introspection Request: “Authentication credentials were not provided.”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM