flask-jade2underscore

Adds suppot for Jade2Underscore templates compiler to Flask
Download

flask-jade2underscore Ranking & Summary

Advertisement

  • Rating:
  • License:
  • MIT/X Consortium Lic...
  • Price:
  • FREE
  • Publisher Name:
  • Manuel Albarran
  • Publisher web site:
  • https://github.com/weapp/

flask-jade2underscore Tags


flask-jade2underscore Description

flask-jade2underscore is a tiny Flask extension that allows developers to easily use Jade to Underscore templates compiler, which is used in Backbone, with their Flask app.InstallationInstall with PIPpip install flask-jade2underscoreUsageThis extension can be activated it by calling the jade2underscore function with your Flask app as a parameter:from flaskext.jade2underscore import jade2underscorejade2underscore(app, underscore_folder='templates', jade_folder='src/jade')This will intercept the request to /static/underscore_folder and compile de file if is necesary using the files from jade_folder.When you deploy your app you might not want to accept the overhead of checking the modification time of your .jade and .tpl files on each request. A simple way to avoid this is wrapping the jade2underscore call in an if statement:if app.debug: from flaskext.jade2underscore import jade2underscore jade2underscore(app)If you do this you’ll be responsible for rendering the .jade files into .tpl when you deploy in non-debug mode to your production server.Product's homepage


flask-jade2underscore Related Software