Is there an idiomatic file extension for Jinja templates?

2021 update:: Jinja now officially recommends using the extension .jinja. check docs


Update:
Things changed since I wrote this answer, .jinja2 and .j2 are trending.


Jinja Authors did not define a default extension. Most of Jinja template editors like Vim extension, TextMate extension, Emacs extension, and PyCharm mention no default extension to enforce Jinja highlighting.

Django had already a similar debate about setting a default extension, and ended as a wontfix issue. I quote from the closing message:

Filetype detection based on extension is flawed for the very reasons described in these comments, so you have to do some internal inspection, just like MIME type detection works.

I suggest that you should use your own since there is no common one.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)