2014-07-26 21 views
0

我已经在Hellosign注册了一个应用程序,并在本地使用django项目。Django:Hellosignup回调url无法查看

虽然restringing应用程序它需要域的URL OAuth回调,因为我使用的是本地主机,我给了一个回调url生成https://ngrok.com/

像:https://1a2df3ef.ngrok.com/test/oauth

Django的OAuth的URL映射为像

url(r'^hellosign/oauth', 'hellosignup_oauth'), 

视图

def hellosignup_oauth(request): 
    code = request.GET.get('code') 
    return render(request, 'hello.html', {'code': code}) 

在授权的请求时等

https://1a2df3ef.ngrok.com/test/oauth?&code=17c2264f2a24741c&state=900e06e2 

和ngrok收到

hellosign/oauth 

请求似乎有两个问题:

1)ngrok应该接受请求hellosign/oauth?&code=17c2264f2a24741c&state=900e06e2,而不是hellosign/oauth

2)hellosign/oauth视图不被称为上请求hellosign/oauth

任何了解?

回答

0

这不应该是一个问题,但它看起来像你有一个空的URL参数(即“?&”)。难道是Django看到空的第一个参数并放弃第二个参数吗?