【问题标题】:DRF browsable API is not working in "django-rest-passwordreset" packageDRF 可浏览 API 在“django-rest-passwordreset”包中不起作用
【发布时间】:2019-03-05 13:51:23
【问题描述】:

我目前正在使用django-rest-passwordreset 包,但是当我去重置密码端点时,DRF 可浏览 API 不起作用(包文档提到可浏览 API 支持可用)。

urlpatterns = [
    path('password-reset/', include('django_rest_passwordreset.urls', namespace='password_reset')),
]

我需要更改任何设置吗?

【问题讨论】:

    标签: django api browsable


    【解决方案1】:

    从 setting.py 中删除所有默认的身份验证和权限类并尝试

    【讨论】:

      【解决方案2】:
      REST_FRAMEWORK = {
      'DEFAULT_AUTHENTICATION_CLASSES': (
          'rest_framework.authentication.BasicAuthentication',
          'rest_framework.authentication.SessionAuthentication',
      )
      

      }

      你把这个添加到你的设置中,py删除这个BasicAuthentication,SessionAuthentication。如果仍然无法使用browseble图像发布问题

      【讨论】:

      • 我检查了这个并评论了设置身份验证方法。什么都没有改变!
      猜你喜欢
      • 1970-01-01
      • 2013-09-20
      • 2021-02-28
      • 2016-08-16
      • 2018-12-25
      • 2019-04-12
      • 1970-01-01
      • 2021-11-02
      • 2016-04-04
      相关资源
      最近更新 更多