Pylons - url.current() 不正确,因为“/test"显示“/test/test"? [英] Pylons - url.current() incorrect, for '/test' shows '/test/test'?
问题描述
我有一个 pylons 设置,在 nginx 中使用了 flup,并且 url.current()
总是返回完全错误的.
I've got a pylons setup, using flup with nginx, and url.current()
always returns totally wrong.
我有一条路线:
map.connect('testpage', '/test', controller='Main', action='test')
在那个控制器中,我执行 url.current() 并得到 /test/test' 而不是 '/test'.我已经尝试更改
SCRIPT_NAME`,因为有关使用 uwsgi 的各种帖子建议,但在这里没有区别.
And in that controller, I do url.current() and I get /test/test' instead of '/test'. I've tried changing
SCRIPT_NAME` as various posts about using uwsgi suggest, but it makes no difference here.
有什么建议吗?
推荐答案
实际上看起来我解决了这个问题.显然,您必须将 SCRIPT_NAME 设置为 '' 并重新启动 Pylons 应用程序,我以前显然没有尝试过.
Actually it looks like I solved this. Apparently you have to set SCRIPT_NAME to '' AND restart the Pylons application, which I apparently hadn't tried before.
所以如果其他人有这个问题 - 重新启动 Pylons :)
So if anyone else has this problem - restart Pylons :)
这篇关于Pylons - url.current() 不正确,因为“/test"显示“/test/test"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!