2016-05-23 38 views
0

我已經Django應用程序部署在Azure中的Web應用程序App.The使用的開發工作正常從電子郵件報名,網址是類似的東西:Django的URL錯誤

http://testApp.azurewebsites.net/activate/InRoY4Jua1BhYnYuYmci:1b4pyC:R2Gak--Jwgl0z5gqb0mF6a9OPfU/ 

我得到這個錯誤:

The request could not be understood by the server due to malformed syntax. 

因此,從URL中刪除「:」請求的作品(它給無效激活鏈接錯誤)

我怎麼能讓我的天藍色應用程序在我的網址中使用「:」?

感謝benjguin的解決方案!

最終使用:從無效字符:

<system.web> 
    <httpRuntime requestValidationMode="2.0" requestPathInvalidCharacters="&lt;,&gt;,*,%,&amp;,\,?" /> 
    <compilation debug="true" targetFramework="4.0" /> 
    </system.web> 

這樣,我只是忽略冒號( 「」)。

+0

爲什麼你的網址包含冒號? – Sayse

+0

該URL是從django註冊生成的電子郵件驗證密鑰 – Kristian

回答

1

警告:默認配置過濾潛在危險的URL。以下將禁用此保護。那樣做是有意的。

您可以通過這一個

<system.web> 
    <httpRuntime requestValidationMode="2.0" requestPathInvalidCharacters="" /> 
    <compilation debug="true" targetFramework="4.0" /> 
</system.web> 

說明更換的Web.config

<system.web> 
    <compilation debug="true" targetFramework="4.0" /> 
</system.web> 

的這一部分在這裏可供選擇:https://msdn.microsoft.com/en-us/library/e1f13641(v=vs.100).aspx

您可以編輯從Web.config文件testApp.scm.azurewebsites.net(與portal.azure.com相同的憑據),調試控制檯,CMD,然後cd site\wwwroot。向下滾動到web.Config,您會在左側找到一個帶有筆的徽標,它將在瀏覽器中打開文本編輯器。

Screen shot of Kudu (scm) environment