Fanstatic integration for Flask

25 views
Skip to first unread message

Matthew Good

unread,
Nov 19, 2012, 6:41:30 PM11/19/12
to fans...@googlegroups.com
I've released the initial version of a Flask extension for integrating with Fanstatic:


This extension adds a few features over simply using the Fanstatic WSGI middleware.

It provides a helper to declare the needed resources directly from the template:

  {{ g.fanstatic.needs(
    'js.jquery:jquery',
    'js.handlebars:handlebars',
  ) }}

It also lets you easily wrap existing static files in your Flask app as Fanstatic resources:

  app = Flask(__name__)
  fanstatic = Fanstatic(app)
  fanstatic.resource('js/app.js', name='app_js', depends=[jquery])

and then reference them from the template by name:

  {{ g.fanstatic.needs('app_js') }}

The README covers other usage examples, but let me know if you have any questions or feedback.

Jan-Jaap Driessen

unread,
Nov 21, 2012, 5:31:49 PM11/21/12
to fans...@googlegroups.com, ma...@matt-good.net

Hi Matt,

Thank you for your work. I have updated the fanstatic docs to point to your package.

Cheers, 

JJ

Matthew Good

unread,
Nov 28, 2012, 5:20:23 PM11/28/12
to fans...@googlegroups.com, ma...@matt-good.net


Thanks JJ, and thanks for the hard work on Fanstatic.  It's been making development much easier.

-- Matt
Reply all
Reply to author
Forward
0 new messages