Exemplo n.º 1
0
def wechat_auth_url_request(request):
    #REDIRECT_URI = "http://%s%s" % (request.META['HTTP_HOST'], reverse("login", kwargs={}))
    REDIRECT_URI = request.build_absolute_uri('/').strip("/") + reverse(
        "wechat_auth_login", kwargs={})
    api = WeixinMpAPI(appid=settings.APP_ID,
                      app_secret=settings.APP_SECRET,
                      redirect_uri=REDIRECT_URI)
    redirect_uri = api.get_authorize_login_url(scope=("snsapi_userinfo", ))
    return redirect(
        redirect_uri
    )  #  "GET /zh/authwrapper/weixin/auth_login/?code=081xJ2wf2A2pbJ05JNwf2RPmwf2xJ2wT&state= HTTP/1.1" 302 0
Exemplo n.º 2
0
def wechatlogin(request):
	#REDIRECT_URI = "http://%s%s" % (request.META['HTTP_HOST'], reverse("login", kwargs={}))
	REDIRECT_URI = request.build_absolute_uri('/').strip("/") + reverse("login", kwargs={})
	api = WeixinMpAPI(appid=APP_ID, app_secret=APP_SECRET,redirect_uri=REDIRECT_URI)
	redirect_uri = api.get_authorize_login_url(scope=("snsapi_userinfo",))
	return redirect(redirect_uri)
Exemplo n.º 3
0
def wechatlogin(request):
    REDIRECT_URI = "http://%s%s" % (request.META['HTTP_HOST'], reverse("home", kwargs={}))
    api = WeixinMpAPI(appid=APP_ID, app_secret=APP_SECRET,redirect_uri=REDIRECT_URI)
    redirect_uri = api.get_authorize_login_url(scope=("snsapi_userinfo",))
    return redirect(redirect_uri)
Exemplo n.º 4
0
def wechatlogin(request):
	#REDIRECT_URI = "http://%s%s" % (request.META['HTTP_HOST'], reverse("login", kwargs={}))
	REDIRECT_URI = request.build_absolute_uri('/').strip("/") + reverse("login", kwargs={})
	api = WeixinMpAPI(appid=APP_ID, app_secret=APP_SECRET,redirect_uri=REDIRECT_URI)
	redirect_uri = api.get_authorize_login_url(scope=("snsapi_userinfo",))
	return redirect(redirect_uri)