(request)
return bool(re.search(r"micromessenger", ua, re.IGNORECASE))
判断是否时微信环境
判断是否时微信环境
判断是否时微信环境
def in_wechat(request):
    """判断是否时微信环境"""
    ua = request.META["HTTP_USER_AGENT"]
    return bool(re.search(r"micromessenger", ua, re.IGNORECASE))
def in_wechat ( request ) : ua = request . META [ "HTTP_USER_AGENT" ] return bool ( re . search ( r"micromessenger" , ua , re . IGNORECASE ) )