0

Converting a project from django into a flask API backend + backbone.js frontend

It was nice to be able to do {% include %} options in the HTML in order to make it more modular, i.e. I was able to separate out a discrete navbar.html, base.html, etc.

Is there an easy way to recreate this same structure in the absence of a web framework and if I am just building a frontend in HTML / JS?

fox
  • 15,428
  • 20
  • 55
  • 85

2 Answers2

3

There are a lot of options, try searching. I usually go with Mustache or Handlebars

Joseph
  • 117,725
  • 30
  • 181
  • 234
  • hmm, but I'd need to have a local flask instance to use something like this, correct? – fox Apr 04 '13 at 06:18
1

If you were looking for something pretty lightweight, you could try this https://github.com/psychobunny/dcp.templates

It was modelled after PHP templating engines like Smarty / phpBB's, but without much complexity... great for abstracting template files.

Otherwise like Joseph said, Handlebars is the way to go!

psychobunny
  • 1,247
  • 9
  • 16