HTML Templates

Jinja2 syntax equivalent to Django's URL name and static

  • Posted on: 4 April 2015
  • By: oon
Django's template URL name like for Jinja2

(after start using Jinja2 on Django)

I need to use Django syntax {% url %} in Jinja2, here's my reference [1].

{{ url('index', args=[variable]) }}

And Django syntax {% static %} also similar.

{{ static('path') }}

hope it helps!

[1]https://medium.com/@samuh/using-jinja2-with-django-1-8-onwards-9c58fe1204dc