开发者

problem with urlpatterns in django

开发者 https://www.devze.com 2023-02-10 21:26 出处:网络
why the url pattern like this: api/actions/info/(?P<user_id>)/(?P<action_id>)/ does开发者_JAVA百科 not recognize this url:

why the url pattern like this:

api/actions/info/(?P<user_id>)/(?P<action_id>)/

does开发者_JAVA百科 not recognize this url:

http://address/api/actions/info/3/4/ 


Because you don't actually match anything within the groups.

Use

^api/actions/info/(?P<user_id>\d+)/(?P<action_id>\d+)/


You've named your groups, but they don't actually contain anything.

api/actions/info/(?P<user_id>\d+)/(?P<action_id>\d+)/
0

精彩评论

暂无评论...
验证码 换一张
取 消