[英]django rest API development Using Swagger UI, got“detail”: “Authentication credentials were not provided.”
currently involving in a django- based project, working on rest API development. 目前参与一个基于django的项目,从事剩余API的开发。 Using Swagger for tracking docs.
使用Swagger跟踪文档。 Everything went well until today.
一切顺利,直到今天。 Today I tried to add some testcase for endpoints.
今天,我尝试为端点添加一些测试用例。 In order to make test work, for some reason, I need to set SOUTH_TESTS_MIGRATE = False and remove allauth.socialaccount from INSTALLED_APPS in settings.
为了使测试有效,出于某种原因,我需要设置SOUTH_TESTS_MIGRATE = False并从设置中的INSTALLED_APPS中删除allauth.socialaccount。 But after that the response code return 403 when I tried to use Swagger for tracking every endpoints in API.
但是之后,当我尝试使用Swagger跟踪API中的每个端点时,响应代码返回403。
Here is the response body {"detail": "Authentication credentials were not provided."}. 这是响应正文{“ detail”:“未提供身份验证凭据。”}。
What I have done to try to fix this issue is set back settings. 我为解决此问题所做的工作是撤回设置。 But still return the same response code and response body.
但是仍然返回相同的响应代码和响应主体。
Anyone have any ideas about this issue? 有人对这个问题有任何想法吗? Super wired since it should work when setting back all settings.
超级有线,因为它应该在重新设置所有设置时起作用。 Thanks in advanced!
提前致谢!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.