I am looking for Twig documentation for Django and I haven't found much. I have read about Twig for PHP especially for Symfony 2. I have some queries about Twig, for instance:
{% for i in range(5) %}
, but it doesn't work for me.| upper
or | lower
. Maybe ucfirst
or wcword
? I am a PHP programmer, and this is what I'm used to.static
in my templates. I have tried {% load static %}
, but when I include a static element like a javascript file or stylesheet, for instances, <script href="{{ static "js/file.js"}}" ></script>
, Django always throws an exception related to rendering it.It only makes sense that you haven't found any documentation for using Twig with Django because there is none! Twig is a PHP templating engine that uses a syntax similar to the Django templating system. This is the source of your confusion, from what I see.
Check out the Django templating system documentation for the actions you want to perform.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With