Python 路由非参数通配符
我正在使用塔,并且在终止“/”字符时遇到麻烦,简单地说,我想忽略它。 我的路由文件如下所示:
with map.submapper(path_prefix='/app', controller='app') as m:
m.connect('{_:/?}', action='index')
我很想写 /?
而不是 {_:/?}
,因为它设置请求 _ 字段到某个东西,如果我重定向,我必须手动取消设置它。我怎样才能实现这个目标?
谢谢
I am using pylons and have a trouble with the terminating '/' character, simply, I want to ignore it.
My route file looks like this:
with map.submapper(path_prefix='/app', controller='app') as m:
m.connect('{_:/?}', action='index')
and I would like much to write /?
instead of {_:/?}
, as it sets the request _
field to something, and I have to unset it manually if I redirect. How can I achieve this?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用“”代替“
{_:/?}
”或“/?
”:Instead of "
{_:/?}
" or "/?
", use "":