librelist archives

« back to archive

Flask URL/Routing Problems

Flask URL/Routing Problems

From:
Christoph Heer
Date:
2010-11-05 @ 18:04
Hi everyone,

I work since some weeks with Flask and it was never so great to write
web apps. But now I have a problem with the connection between flask
and lighttpd. I use the fastcgi module from lighttpd same as in the
documentation of flask. It use an fcgi script which create a WSGI
server, also I use the LighttpdCGIRootFix from werkzeug.

Routes of my app:
/ => index()
/login => login()
/logout => logout()
/settings/ => settings()
/settings/webpresence => settings_webpresence()

When I now call the app with http://app.example.com/ than the index()
function will be call, also this works. But when I request
http://app.example.com/login than I get a 404 error. So I create 404
errorhandler which return the flask.request.url string than I can see
that the url was http://app.example.com/login/login. When I request
the url http://app.example.com/settings/ than the app redirected me to
the login site by using the url_for function which create the url
http://app.example.com/login but I get a 404 error and see that I
request http://app.example.com/login/login but when I look in my
debugging proxy or firebug I see that my browser request
http://app.example.com/login.

I hope my explanation is understandable. Now I search a solution for
my problem but I don’t found something. I tried to change the “mount
point” of the app to http://app.example.com/app/ but same error only
that /app/ was added. Have someone any idea which what I can try?

Best regards
Christoph