【问题标题】:Why django can not match double slashes correctly in URL?为什么 django 不能正确匹配 URL 中的双斜杠?
【发布时间】:2011-07-08 19:58:36
【问题描述】:

我正在尝试使用此 URL 模式:

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

像这样匹配 URL:

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

但令我惊讶的是,我发现 next 的值竟然是:

http://google.com/

似乎双斜线以某种方式压缩成一个斜线。

为什么 django 会有这样的行为,是否有解决方法?

【问题讨论】:

    标签: django


    【解决方案1】:

    这张 Django 票可能会让你朝着正确的方向前进:https://code.djangoproject.com/ticket/14346

    还有:Diggbar modrewrite- How do they pass URLs through modrewrite?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-03-14
      • 2021-05-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-06-19
      • 2016-12-13
      相关资源
      最近更新 更多