开发者

problem with urlpatterns in django

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜