I am very new to django and working on it.. I visited a html file and dont know the difference between {{}} and {% %} in html files used as here
{% load static %}
Thanks a lot
You can use
{% %}
For sentences such as if
and for
or to call tags such as load
, static
, etc.
{{ }}
To render variables in the template.
Read More about it at Django Docs
{% %}
is for displaying code and {{}}
is for displaying variables
There are three things in the template in Django
First is template variable and the second thing is template tag and third and last is template filter
so we write a template variable is {{}}
and write a template tag is {% %}
third and last is template filter {{variable |filter:arg}}
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