def static_url ( path , absolute = False ) : if os . sep != '/' : path = '/' . join ( path . split ( os . sep ) ) return flask . url_for ( 'static' , filename = path , _external = absolute )
python flask generate link to external file
Shorthand for returning a URL for the requested static file .
def static_url(path, absolute=False):
    """ Shorthand for returning a URL for the requested static file.

    Arguments:

    path -- the path to the file (relative to the static files directory)
    absolute -- whether the link should be absolute or relative
    """

    if os.sep != '/':
        path = '/'.join(path.split(os.sep))

    return flask.url_for('static', filename=path, _external=absolute)