开发者

Uncommon django urlpattern

Suppose I've got urls on my site which look like /qwe/asd/zxc/wer/sdf/xcv/ (unknown number of \w+ blocks separated by slashes).

Is that possible? to construct a urlpattern to catch those urls so that:

  1. a view function would get all those \w+ strings in *args list to it
  2. the {% url qwe asd zxc wer sdf xcv %} templatetag would reconstruct supposed /qwe/asd/zxc/开发者_高级运维wer/sdf/xcv/ url the right way

Thanks


For No.1 (r'^(?P<url>[\w/]+)$', 'views.handler') could do that.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜