Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python django是否本机与HTTP基本授权集成_Python_Django_Http_Authentication_Basic Authentication - Fatal编程技术网

Python django是否本机与HTTP基本授权集成

Python django是否本机与HTTP基本授权集成,python,django,http,authentication,basic-authentication,Python,Django,Http,Authentication,Basic Authentication,我的系统组件之一是使用基本的HTTP身份验证()来获取登录信息。我的系统的另一部分是运行django应用程序,它使用“django.contrib.auth”应用程序进行身份验证 你喜欢这个工作吗 def urlHandler(request): if request.user.is_authenticated(): // ... 在本例中,urlHandler将处理请求,该请求的HTTP GET中附加了授权:Basic dXNlcjpwYXNz。django授权后端会与

我的系统组件之一是使用基本的HTTP身份验证()来获取登录信息。我的系统的另一部分是运行django应用程序,它使用“django.contrib.auth”应用程序进行身份验证

你喜欢这个工作吗

def urlHandler(request):
  if request.user.is_authenticated():    
     // ...
在本例中,urlHandler将处理请求,该请求的HTTP GET中附加了
授权:Basic dXNlcjpwYXNz
。django授权后端会与此集成吗

显然,我尝试了上面的代码,但它似乎不起作用

在这种情况下是否有一个中间件可以工作


谢谢

我们已经询问并回答了以下问题:


(答案是肯定的。有关详细信息,请参阅。)

看看@Reto:Ah!它没有出现在搜索中!