Django url pattern - string parameter

前端 未结 6 586
面向向阳花
面向向阳花 2021-02-06 21:10

Django url pattern that have a number parameter is:

url(r\'^polls/(?P\\d+)/$\', \'polls.views.detail\')

What will be the correct

6条回答
  •  旧时难觅i
    2021-02-06 21:31

    Depends on what characters you care about. Like the docs say, \w will give you an alphanumeric character or an underscore.

提交回复
热议问题