开发者

Why django can not match double slashes correctly in URL?

开发者 https://www.devze.com 2023-03-18 20:41 出处:网络
I\'m trying to use this URL pattern: (r\'^welcome/(?P.+)/$\', \'welcome\'), 开发者_JAVA技巧 to match URL like this:

I'm trying to use this URL pattern:

(r'^welcome/(?P.+)/$', 'welcome'),

开发者_JAVA技巧

to match URL like this:

http://localhost:9000/welcome/http://google.com/

but to my surprise, I found the value of next turned out to be:

http:/google.com/

It seems that double slashes are somehow compressed into one slash.

Why django behave like this and is there workaround?


This Django ticket might get you going in the right direction: https://code.djangoproject.com/ticket/14346

also: Diggbar modrewrite- How do they pass URLs through modrewrite?

0

精彩评论

暂无评论...
验证码 换一张
取 消