Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

port to Jinja2 #1783

Closed
chadwhitacre opened this issue Dec 18, 2013 · 9 comments
Closed

port to Jinja2 #1783

chadwhitacre opened this issue Dec 18, 2013 · 9 comments
Labels

Comments

@chadwhitacre
Copy link
Contributor

Advantages over Tornado 1.x:

  1. easier to debug (probably? provide better tracebacks for templating errors #1381)
  2. supports i18n (i18n #1030)
  3. provides super (IRC)

Granted, Tornado 1.x is ancient. However, 3.x may address (1) but afaict they don't address (2) nor (3).

@chadwhitacre
Copy link
Contributor Author

Error-reporting is currently... uh, interesting.

Looks like they haven't even addressed (1) yet.

@zwn
Copy link
Contributor

zwn commented Dec 18, 2013

👍

@clone1018
Copy link
Contributor

It seems like Jinja2's goal is to keep python out of templates. Which is does by rendering the templates in a new context, so we don't have any python functions out of the box, we have to "approve" specific ones we want.

I've made a semi complete comparison of a couple of templating engines I found for python.

2013-12-18_20-52-34

@clone1018
Copy link
Contributor

So far Mako looks pretty good but the syntax is different, Django also looks good.

@clone1018
Copy link
Contributor

It doesn't look like Django's Templating Engine is modular though, so we wouldn't be able to easily pull it out for use with Aspen. Mako is it's own thing that can easily be included in our project.

@chadwhitacre
Copy link
Contributor Author

I'm pretty sure we don't want embedded Python syntax.

What's wrong with whitelisting template-global functions?

@clone1018
Copy link
Contributor

Global functions includes native Python functions. That's not a limitation of tornado.

And our template loops and calls look like python, but the Jinja the syntax is different.

On my phone so I will clarify later.

@clone1018
Copy link
Contributor

Cool, we talked about it in IRC and decided on Jinja2

@zwn
Copy link
Contributor

zwn commented Jan 7, 2014

Anything missing here? I don't think so.

@zwn zwn closed this as completed Jan 7, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants