开发者

Django urls on json request

When making a django request through json as,

 var info=id + "##" +name+"##"
 $.post("/supervise/activity/" +开发者_开发技巧 info ,[] ,
 function Handler(data,arr) 
  {

  } 

In urls.py

  (r'^activity/(?P<info>\d+)/$, 'activity'),

In views,

 def activity(request,info):
     print info

The request does not go through.info is a string.How can this be resolved

Thanks..


^activity/(?P<info>\d+)/$ will only match something like 'activity/42/' and the number (in this case 42) will be info.

If you appended '##name##' to the url, it will not be recognized.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜