def METHOD_NAME(request):
    if not ENABLE_WEIXIN:
        return render_error(request, _('Error, please contact administrator.'))
    state = str(uuid.uuid4())
    request.session['weixin_oauth_login_state'] = state
    request.session['weixin_oauth_login_redirect'] = request.GET.get(auth.REDIRECT_FIELD_NAME, '/')
    data = {
        'appid': WEIXIN_OAUTH_APP_ID,
        'redirect_uri': get_site_scheme_and_netloc() + reverse('weixin_oauth_callback'),
        'response_type': WEIXIN_OAUTH_RESPONSE_TYPE,
        'scope': WEIXIN_OAUTH_SCOPE,
        'state': state,
    }
    url = WEIXIN_OAUTH_QR_CONNECT_URL + '?' + urllib.parse.urlencode(data)
    return HttpResponseRedirect(url)