How Do I Use A Decimal Number In A Django URL Pattern?

前端 未结 4 1587
终归单人心
终归单人心 2021-01-11 17:52

I\'d like to use a number with a decimal point in a Django URL pattern but I\'m not sure whether it\'s actually possible (I\'m not a regex expert).

Here\'s what I wa

4条回答
  •  日久生厌
    2021-01-11 18:37

    I don't know about Django specifically, but this should match the URL:

    r"^/item/value/(\d+\.\d+)$"
    

提交回复
热议问题