Mako vs Jinja2

1,639 views
Skip to first unread message

Gour

unread,
Sep 4, 2017, 6:30:22 AM9/4/17
to mako-d...@googlegroups.com
Hello,

I'm starting learning Python and have to learn some templating engine to be
used for creating themes for Nikola static-site-generator which does support
both Mako and Jinja2.

I believe that speed is not major concern for static-site-generator, but wonder
if there are some other concerns I should take into consideration when deciding
between the two?


Sincerely,
Gour

--
As fire is covered by smoke, as a mirror is covered by dust,
or as the embryo is covered by the womb, the living entity is
similarly covered by different degrees of this lust.


Roberto Alsina

unread,
Sep 4, 2017, 9:29:00 AM9/4/17
to mako-d...@googlegroups.com
On Mon, Sep 4, 2017 at 7:30 AM Gour <go...@atmarama.com> wrote:
Hello,

I'm starting learning Python and have to learn some templating engine to be
used for creating themes for Nikola static-site-generator which does support
both Mako and Jinja2.

I believe that speed is not major concern for static-site-generator, but wonder
if there are some other concerns I should take into consideration when deciding
between the two?


Some template systems have more "power" than others, in the sense that some allow you to use the full power of python while others don't allow for any logic in the templates.

Mako is perhaps slightly more powerful than jinja in that sense (but I am not even going to check).

If you do it in Mako you can probably autoconvert to jinja using our jinjify script.
 
Use the one you like best.

Mike Bayer

unread,
Sep 4, 2017, 7:44:58 PM9/4/17
to mako-d...@googlegroups.com
I can tell you that Jinja is a lot more polished than Mako at this
point. It was developed later with a more organized concept to start
with, and it has multiple developers now continuing to put a lot of
work into it. Mako of course works great and it's still what I use,
but that's because I wrote it :). I don't have the resources to
maintain it beyond keeping it basically working these days and I've
usually never been able to get dedicated long-term helpers on any of
my projects.
> --
> You received this message because you are subscribed to the Google Groups
> "Mako Templates for Python" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mako-discuss...@googlegroups.com.
> To post to this group, send email to mako-d...@googlegroups.com.
> Visit this group at https://groups.google.com/group/mako-discuss.
> For more options, visit https://groups.google.com/d/optout.

Gour

unread,
Sep 5, 2017, 2:18:28 AM9/5/17
to mako-d...@googlegroups.com
On Mon, 04 Sep 2017 13:28:48 +0000
Roberto Alsina <ral...@kde.org> wrote:

> Mako is perhaps slightly more powerful than jinja in that sense (but
> I am not even going to check).

Do you consider it's relevant in the context of Nikola?


Sincerely,
Gour

--
In the material world, one who is unaffected by whatever good
or evil he may obtain, neither praising it nor despising it,
is firmly fixed in perfect knowledge.


Gour

unread,
Sep 5, 2017, 2:26:49 AM9/5/17
to mako-d...@googlegroups.com
On Mon, 4 Sep 2017 19:44:56 -0400
Mike Bayer <cla...@zzzcomputing.com> wrote:

> I can tell you that Jinja is a lot more polished than Mako at this
> point. It was developed later with a more organized concept to start
> with, and it has multiple developers now continuing to put a lot of
> work into it. Mako of course works great and it's still what I use,
> but that's because I wrote it :).

Thank you very much for your input.

> I don't have the resources to maintain it beyond keeping it basically working
> these days and I've usually never been able to get dedicated long-term
> helpers on any of my projects.

Heh, there is expression: "that's the way the cookie crumbles sometimes!" ;)


Sincerely,
Gour

--
Therefore, without being attached to the fruits of activities,
one should act as a matter of duty, for by working without
attachment one attains the Supreme.


Jonathan Vanasco

unread,
Sep 11, 2017, 12:34:45 AM9/11/17
to Mako Templates for Python
I use both libraries regularly.

In terms of static site generators: they're both comparably fast and memory efficient. I prefer using Mako, because I prefer some slight differences in the behavior of template inheritance and including partials/macros.  Both engines are essentially capable of the rendering the same project/layouts, the big difference is how your files will be structured.  the usage differences in this context will be very slight
Reply all
Reply to author
Forward
0 new messages