Regex django url

后端 未结 2 954
眼角桃花
眼角桃花 2021-02-13 02:37

Hello I have a url and I want to match the uuid the url looks like this:

/mobile/mobile-thing/68f8ffbb-b715-46fb-90f8-b474d9c57134/

<
2条回答
  •  半阙折子戏
    2021-02-13 03:28

    Try this regex instead:

    \/mobile-thing\/(?P.*)\/$
    

    So it'd be:

    urlpatterns = patterns("mobile.views",
        url(r'^$', 'something_cool', name='cool'),
        url(r'\/mobile-thing\/(?P.*)\/$', 'mobile_thing', name='mobile-thinger'),
    )
    

提交回复
热议问题