My Django URLs not picking up dashes

后端 未结 1 689
北荒
北荒 2021-02-03 21:13

Im trying to work out a url that will match domain.com\\about-us\\ & domain.com\\home\\

I have a url regex:

^(?P\\w+)/$
<
相关标签:
1条回答
  • 2021-02-03 22:06

    Try: ^(?P<page>[-\w]+)/$

    [-\w] will accept a-z 1-9 and dash

    0 讨论(0)
提交回复
热议问题