Skip to content

Instantly share code, notes, and snippets.

@joeyespo
Created November 10, 2012 19:50
Show Gist options
  • Save joeyespo/4052265 to your computer and use it in GitHub Desktop.
Save joeyespo/4052265 to your computer and use it in GitHub Desktop.
Provides the static_for jinja helper function.
# 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