Forum

Flask python framework via fastCGI with Hiawatha

Leonard Techel
31 July 2011, 13:33
Hello,
I'm trying to use the flask framework with hiawatha over python, but hiawatha seems to put always the actual path into the PATH_INFO of fastCGI. The result are pathes like /index.html/static/style.css or /register/login instead of /static/style.css or /login. My configuration looks like this:
FastCGIServer {
FastCGIid = feabook_fcgi
ConnectTo = /tmp/feabook.sock
}
UrlToolkit {
ToolkitID = feabook_tk
RequestURI isfile Return
Match .* UseFastCGI feabook_fcgi
}
VirtualHost {
Hostname = foreveralonebook.de
WebsiteRoot = /var/www/foreveralonebook-de/public

UseToolkit = feabook_tk
EnablePathInfo = yes
}


If you like to try it out you can put the ip 178.63.115.229 or 2001:470:1f0a:1c6b::2 for foreveralonebook.de into your /etc/hosts.

Hiawatha version: 7.5
Operating System: Debian 6, 2.6.32-5-amd64
Hugo Leisink
31 July 2011, 13:47
Do the files /index.html and /register exist? And btw, PATH_INFO only works when a CGI script is part of the URL.

If you ask me, it's best to avoid PATH_INFO. It was a bad decision when it was introduced a long time ago as a web technique. The usage of it in a web framework is an indication of bad design of that framework.
Leonard Techel
31 July 2011, 14:35
Thank you for your reply

The file index.html does not exist. Flask do not use a file for each page. If you ask for /register, it'll make the content of /register.

Mhh, I think I have to do it in my applications code :/
This topic has been closed.