def METHOD_NAME(request):
    """
    是否来自微信访问
    """
    if weixin_settings.USE_WEIXIN and request.path.startswith(weixin_settings.WEIXIN_SITE_URL) and \
            request.get_host() == weixin_settings.WEIXIN_APP_EXTERNAL_HOST:
        return True
    return False