Are there any template engines for Python with a syntax similar to Jade or HAML?
4 Answers
Check the pyjade
Python package here at pypi, and here at github.
Pyjade is a Jade syntax adapter for Django, Jinja2 and Mako templates
Disclaimer: I am the owner :)

- 50,406
- 14
- 85
- 110

- 1,249
- 12
- 20
-
Is it close to 100% compatible with jade so that I can share templates between client and server? – Eric Oct 02 '12 at 12:05
-
1@Eric is totally compatible. I also have published the package `jsjinja` for Python, which compiles the jinja2 templates to javascript ;). Check it out! https://github.com/syrusakbary/jsjinja – Syrus Akbary Nieto Dec 07 '12 at 13:19
-
3Jade is awesome, and it would be great if pyjade could render directly to html that Django will serve, rather than converting first to Django template lang. Then it would rightfully be a Django template engine. I have a feeling jade templating would have better performance than Django templating. – André Staltz Jul 21 '13 at 11:00
-
1@SyrusAkbaryNieto PyJade is *not* 100% compatible with mainline Jade – xj9 Mar 11 '15 at 16:20
I really love jade. Pyjade made it possible to use jade in some python project with jinja or django.
But I have to say that pyjade is not 100% compatible with jade.
For example, ternary operator is not supported in pyjade. You can use some python syntax to do the same thing, But that will make the template only can be used with pyjade but not the original jade.
So if you want to share same templates between jade and pyjade, STOP. but if you just want to use jade syntax in a python project, pyjade will be good choice.

- 356
- 2
- 5
I'm not familiar with Jade, but I suspect you'll find this SO post interesting: HAML implementation for python / django