如何在我的Django网络应用程序上阻止Internet Explorer? [英] How to block internet explorer on my Django web app?
本文介绍了如何在我的Django网络应用程序上阻止Internet Explorer?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在开发一个与Internet Explorer不兼容的Web应用程序(Web套接字,json,安全问题)。
目前,在我的申请之前适用于IE:
如何拒绝来自Internet Explorer客户端的连接?
谢谢
解决方案
还有另外一种方法!只需使用设置变量 DISALLOWED_USER_AGENTS ,并确保 CommonMiddleware 已安装在您的网站上。<例如
import re
DISALLOWED_USER_AGENTS =(re .compile(r'msie \ s * [2-7]',re.IGNORECASE),)
干杯!
I'm working on a web application that does not work well with Internet Explorer (web socket, json, security issues).
For now, before my application works with IE:
How can I refuse connections coming from Internet Explorer client ?
Thank you
解决方案
There is another way! Just use settings variable DISALLOWED_USER_AGENTS, and make sure that CommonMiddleware is installed on your site.
For example
import re
DISALLOWED_USER_AGENTS = (re.compile(r'msie\s*[2-7]', re.IGNORECASE), )
Cheers!
这篇关于如何在我的Django网络应用程序上阻止Internet Explorer?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文