286
Sf
simple-flask-coffee-sass-boilerplate / files
simple-flask-coffee-sass-boilerplate / greeter.py
1.1 KB
1import os 2 3from flask import Flask 4from flask import render_template 5from flask.ext.assets import Bundle 6from flask.ext.assets import Environment 7 8DEBUG = True 9 10app = Flask(__name__) 11app.debug = DEBUG 12 13assets = Environment(app) 14assets.debug = DEBUG 15 16assets.load_path = [ 17 os.path.join(os.path.dirname(__file__), 'sass'), 18 os.path.join(os.path.dirname(__file__), 'coffee'), 19 os.path.join(os.path.dirname(__file__), 'bower_components'), 20] 21 22assets.register( 23 'css', 24 Bundle( 25 '**/*.css', 26 Bundle( 27 '*.sass', 28 filters="sass", 29 output="sass.css" 30 ), 31 filters="cssmin", 32 output="style.css" 33 ) 34) 35 36assets.register( 37 'js', 38 Bundle( 39 'three.js/three.js', 40 'jquery/dist/jquery.js', 41 Bundle( 42 '*.coffee', 43 filters='coffeescript', 44 output='coffee.js' 45 ), 46 filters='jsmin', 47 output="app.js" 48 ) 49) 50 51 52@app.route('/') 53@app.route('/<text>') 54def greet(text="Welcome to the world of tomorrow!"): 55 return render_template('index.html', text=text) 56 57if __name__ == '__main__': 58 app.run(host='0.0.0.0')