Using Jinja2 in Django with Coffin: The Easy Way

pThere is stronga lot/strong of old, incorrect and just plain bad documentation on how to use the a href=""Jinja2 templating language/a in a href=""Django/a. Here#8217;s how to do it strongThe Easy Way/strong./p

ollipInstall Jinja2, a href=""Pygments/a and a href=""Coffin/a with codeeasy_install Jinja2 Pygments Coffin/code or by editing your a href=""Pip requirements.txt file/a./p/li
lipIn, change:/p

precodefrom django.shortcuts import render_to_response


precodefrom coffin.shortcuts import render_to_response

pa href=""as described in the Coffin docs/a./p/li
lipa href=""Update your templates to use Jinja2 syntax/a. Change codeblock.super/code to codesuper()/code./p/li
lipIf you use code{% compress %}/code tags, add:/p


pto your a href=""as described here/a./p/li
/olimg src="" height="1" width="1"/