Created
November 10, 2012 19:50
-
-
Save joeyespo/4052265 to your computer and use it in GitHub Desktop.
Provides the static_for jinja helper function.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For use within a Flask application using 'app' | |
def static_for(filename, endpoint='.static'): | |
"""Gets the specified static file.""" | |
return url_for(endpoint, filename=filename) | |
app.jinja_env.globals.update(static_for=static_for) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment