13.07.2015 Views

Modern Web Applications with Flask and Backbone.js

Modern Web Applications with Flask and Backbone.js

Modern Web Applications with Flask and Backbone.js

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

flask-assets crash course●●●<strong>Flask</strong> extension wrapping the webassets packageDeclaratively define your pages' assetsAssets are filtered during deployment / on the fly (development)from flask.ext.assets import Environment, Bundlefrom .app import appassets = Environment(app)coffee = Bundle('<strong>js</strong>/lib/lib.coffee', '<strong>js</strong>/lib/auth.coffee',filters="coffeescript", debug=False,output="gen/base.coffee.<strong>js</strong>")<strong>js</strong> = Bundle('<strong>js</strong>/vendor/underscore.<strong>js</strong>','<strong>js</strong>/vendor/backbone.<strong>js</strong>', coffeeoutput="gen/base.<strong>js</strong>", filters="yui_<strong>js</strong>")assets.register('base.<strong>js</strong>', <strong>js</strong>)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!