Pylons - url.current() incorrect, for '/test' shows '/test/test'?

懵懂的女人 提交于 2020-01-03 04:34:10

问题


I've got a pylons setup, using flup with nginx, and url.current() always returns totally wrong.

I have a route:

map.connect('testpage', '/test', controller='Main', action='test')

And in that controller, I do url.current() and I get /test/test' instead of '/test'. I've tried changingSCRIPT_NAME` as various posts about using uwsgi suggest, but it makes no difference here.

Any suggestions?


回答1:


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.

So if anyone else has this problem - restart Pylons :)




回答2:


in nginx i do

#fastcgi_param SCRIPT_NAME $fastcgi_script_name;



来源:https://stackoverflow.com/questions/3842692/pylons-url-current-incorrect-for-test-shows-test-test

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!