librelist archives

« back to archive

Static files being overshadowed by another route

Static files being overshadowed by another route

From:
Desmond Rivet
Date:
2013-01-03 @ 02:26
Hi all,

I have a route set up like this:

@app.route('/<path:category>/<slug>.<flav>')
def blah...

And my flask app is created with an explicit static_url_path of "/static".

My static files are not being served up.  When I try to access
something like /static/site.css (an existing file under the static
folder), it will match on the "slug" route above.

I'm not entirely sure how one route precedence is handled in a flask
app.  I understand that "/static/site.css" does, in point of fact,
match "/<path:category>/<slug>.<flav>", but I would have thought (not
sure why...) that the /static rule would take precedence.  Is that not
how it works?

Thanks in advance for any insight.

Desmond