librelist archives

« back to archive

instance_path seems not what I need

instance_path seems not what I need

From:
Cornelius Kölbel
Date:
2015-01-27 @ 09:36
Hello,

I can run my app without problems on http://mymachine/

I want to run my application in instances in subfolders in apache.
I.E. I do not want to run it from the root URL.

I would configure apache like this:

    WSGIScriptAlias /instance1/       /path/to/my.wsgi

Thus making the app available at http://mymachine/instance1/

I can access the initial index.hml, but the stylesheets, which look like
this

<link href="/static/css/signin.css" rel="stylesheet">

Are of course not accessible.
I can change them to href="static/css/signin.css" which make my browser
search at
/instance1/static/css/signin.css, but nothing there except 404.

The code at the moment looks like this:

app = Flask(__name__, static_folder="static",
            template_folder="static/templates")

And I am also not sure if the parameters static_path or static_url_path
are what I want.
Playing with those parameters did not help much.

Any hint is welcome.

Kind regards
Cornelius