Changing default url to static-media in Flask

I've made a website using Flask and I have no problems getting things to work properly on the built-in development server. I've also been able to get things running on my production server under mod_wgsi. However, I host my static media from a static/CGI/PHP-5.2 application and I can't get Flask to 'see' it without manually changing all the urls in my html files.

The problem seems to be that the basic Flask setup expects static files to be within the flask application. See here for details. Essentially, I think I need to change the url of 'static' portion of the following one liner:

 

It looks like I can change this in init.py, instructions here, but defining the static_path as follows doesn't seem to work.

app = Flask(__name__, static_path = '/web_media')

To be clear, if I manually define my url like this:


everything works fine. Any help would be greatly appreciated.

9
задан Nick Crawford 11 May 2011 в 14:26
поделиться