2014-07-26 29 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看到空的第一個參數並放棄第二個參數嗎?