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:
- a view function would get all those \w+ strings in *args list to it
- 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.
精彩评论