我想使用当前登录到计算机的Windows域帐户(活动目录)来验证django Web用户.如何在不提示用户再次输入用户名/密码的情况下执行此操作,因为他已使用域帐户登录到他的系统.我正在使用django和python 2.7.我通过以下 链接,但dint了解如何在我的视图中使用它.请帮我.
谢谢
如何防止 urllib2.Request 类的默认操作在 python 2.7 中将标头大写。当我创建 urllib2.Request 类实例并默认传递标头时,是否会传递标头的大写,而不是我希望标头在我时为大写提出一个请求。我怎样才能做同样的事情。我发出请求的 Web 服务接受大写的标头(例如 HTTP_REQUEST_VAL)。
提前致谢
我想请求url和django视图应该读取文件并发送http响应回来在浏览器中播放相同的文件.我得到了以下代码但它没有播放任何人请帮助我..现在我很难在代码中编码文件名.
url: http://localhost/playfile/audiofile_name
def playAudioFile(request):
try:
fname="C:\\test\\audio\\t.mp3"
wrapper = FileWrapper(file(fname))
print content_type
response = HttpResponse(wrapper, content_type="audio/mpeg")
print response
response['Content-Length'] =os.path.getsize(fname )
return response
except:
return HttpResponse()
Run Code Online (Sandbox Code Playgroud)
预先感谢..
在我的应用程序中,我将使用 connectwise API,但我不知道如何调用它们的 API,例如
How to connect
How to pass header (json data)
How to authentication (I have company id , public and private key)
How to make call and take response
Run Code Online (Sandbox Code Playgroud)
我是 Python 人 提前致谢