2
@mod.route('/participate/<survey_id>/', defaults = {'work_id':None}, methods = ['GET','POST'])
@mod.route('/pariicipate/<survey_id>/<work_id>', methods = ['GET', 'POST'])
def participate(survey_id, work_id):
/* do_something .. */
我可以访问http://localhost:5000/participate/512dc365fe8974149091be1f
或http://localhost:5000/participate/512dc365fe8974149091be1f/
如果我火了一个调试器,我可以看到work_id = None
。烧瓶可选的URL参数不工作
如果我尝试http://localhost:5000/participate/512dc365fe8974149091be1f/512dc365fe8974149091be1f
或http://localhost:5000/participate/512dc365fe8974149091be1f/512dc365fe8974149091be1f/
我得到404
为什么会出现这种情况?有没有我做了路由规则的错误?
是啊,谢谢你啊! – thkang 2013-03-01 20:39:40
发生在我们身上:) PS:你应该将答案标记为已接受 – entropy 2013-03-01 20:40:49