Apache2 Django {“detail”:”Authentication credentials were not provided.”}

其实项目已经是很久之前就完成了,部署到服务器上去之后后续的工作由于懒散一致没做,近几天开始进行重新继续项目之后发现一个很蛋疼的问题,在iOS端提交数据的时候提示:

{“detail”:”Authentication credentials were not provided.”},搜索之后发现原来是mod_wsgi转发数据的时候将authorization header 去掉了,所以会导致认证失败。可以参考链接:

http://stackoverflow.com/questions/26906630/django-rest-framework-authentication-credentials-were-not-provided

修复也很简单,修改/etc/apache2/apache2.conf文件添加如下一行即可:

WSGIPassAuthorization On
☆版权☆

* 网站名称:obaby@mars
* 网址:https://h4ck.org.cn/
* 个性:https://oba.by/
* 本文标题: 《Apache2 Django {“detail”:”Authentication credentials were not provided.”}》
* 本文链接:https://h4ck.org.cn/2016/05/5892
* 短链接:https://oba.by/?p=5892
* 转载文章请标明文章来源,原文标题以及原文链接。请遵从 《署名-非商业性使用-相同方式共享 2.5 中国大陆 (CC BY-NC-SA 2.5 CN) 》许可协议。


猜你喜欢:

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注